Zum Inhalt springen

Ghostridah

Mitglieder
  • Gesamte Inhalte

    58
  • Benutzer seit

  • Letzter Besuch

Beiträge von Ghostridah

  1. Danke für eure Tipps.

    Nachdem ich das ganze jetzt nochmal mit lupo's Zusatz in der zweiten Zeile ausgeführt habe und immernoch nichts kam habe ich folgendes Probiert:

    <?php
    
    echo 'Stelle 1';
    
    error_reporting(E_ALL);
    
    echo 'Stelle 2';
    
    $link = mysql_connect('localhost', 'USR', 'PWD');
    
    echo 'Stelle 3';
    
    if (!$link) {
    
    	echo 'Keine DB Verbindung';
    
        die('Could not connect: ' . mysql_error());
    
    }
    
    echo 'Connected successfully';
    
    mysql_close($link);
    
    echo 'Ende';
    
    ?>

    Raus kam:

    C:\>php test.php

    Stelle 1Stelle 2

    Er bricht das Script also beim Aufbau der Verbindung ohne jegliche Warnungen/Fehlermeldungen ab...

    Sollte ich es vielleicht mal mit PHP 5.3 versuchen?

  2. @flashpixx ja.... :) Aber die Hoffnung stirbt zuletzt. Vielleicht hätte es ja jemand hier gegeben der das Problem auch mal hatte und irgendwie gelöst hat.

    Google gibt zu viel Müll aus zu dem Thema..

    @Carnie:

    phpinfo sagt:

    mysql

    MySQL Support enabled

    Active Persistent Links 0

    Active Links 0

    Client API version 5.1.37

    Directive Local Value Master Value

    mysql.allow_persistent On On

    mysql.connect_timeout 20 20

    mysql.default_host no value no value

    mysql.default_password no value no value

    mysql.default_port 3306 3306

    mysql.default_socket no value no value

    mysql.default_user no value no value

    mysql.max_links Unlimited Unlimited

    mysql.max_persistent Unlimited Unlimited

    mysql.trace_mode Off Off

    mysqli

    MysqlI Support enabled

    Client API library version 5.1.37

    Client API header version 5.0.51a

    MYSQLI_SOCKET /tmp/mysql.sock

    Directive Local Value Master Value

    mysqli.default_host no value no value

    mysqli.default_port 3306 3306

    mysqli.default_pw no value no value

    mysqli.default_socket no value no value

    mysqli.default_user no value no value

    mysqli.max_links Unlimited Unlimited

    mysqli.reconnect Off Off

    Bis auf die Abweichung der Client API Header/library bei MySQLi mMn nichts auffälliges aber ich benutze mysqli eigentlich auch gar nicht.

    Das Script führ ich gleich mal auf der Konsole aus. Danke für den Code!

  3. Der Log des Datenbankservers ist seit dem letzten (Neu)Start leer:

    090814 11:23:31 [Note] Plugin 'FEDERATED' is disabled.

    090814 11:23:34 InnoDB: Started; log sequence number 0 44233

    090814 11:23:36 [Note] Event Scheduler: Loaded 0 events

    090814 11:23:36 [Note] MySQL: ready for connections.

    Version: '5.1.37-community-log' socket: '' port: 3306 MySQL Community Server (GPL)

  4. httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 19:23:52 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.10 configured -- resuming normal operations

    [Wed Aug 19 19:23:52 2009] [notice] Server built: Dec 10 2008 00:10:06

    [Wed Aug 19 19:23:52 2009] [notice] Parent: Created child process 47792

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 19:23:53 2009] [notice] Child 47792: Child process is running

    [Wed Aug 19 19:23:53 2009] [notice] Child 47792: Acquired the start mutex.

    [Wed Aug 19 19:23:53 2009] [notice] Child 47792: Starting 64 worker threads.

    [Wed Aug 19 19:23:53 2009] [notice] Child 47792: Starting thread to listen on port 80.

    [Wed Aug 19 19:24:33 2009] [notice] Parent: child process exited with status 3221225477 -- Restarting.

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 19:24:33 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.10 configured -- resuming normal operations

    [Wed Aug 19 19:24:33 2009] [notice] Server built: Dec 10 2008 00:10:06

    [Wed Aug 19 19:24:33 2009] [notice] Parent: Created child process 33512

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 19:24:34 2009] [notice] Child 33512: Child process is running

    [Wed Aug 19 19:24:34 2009] [notice] Child 33512: Acquired the start mutex.

    [Wed Aug 19 19:24:34 2009] [notice] Child 33512: Starting 64 worker threads.

    [Wed Aug 19 19:24:34 2009] [notice] Child 33512: Starting thread to listen on port 80.

    Ich habe jetzt loglevel auf debug gesetzt. Vorher stand es auf warning

    Neues logfile:

    [Wed Aug 19 22:34:08 2009] [notice] Parent: child process exited with status 3221225477 -- Restarting.

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 22:34:09 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.10 configured -- resuming normal operations

    [Wed Aug 19 22:34:09 2009] [notice] Server built: Dec 10 2008 00:10:06

    [Wed Aug 19 22:34:09 2009] [notice] Parent: Created child process 2712

    [Wed Aug 19 22:34:09 2009] [debug] mpm_winnt.c(487): Parent: Sent the scoreboard to the child

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 22:34:09 2009] [notice] Child 2712: Child process is running

    [Wed Aug 19 22:34:09 2009] [info] Parent: Duplicating socket 296 and sending it to child process 2712

    [Wed Aug 19 22:34:09 2009] [debug] mpm_winnt.c(408): Child 2712: Retrieved our scoreboard from the parent.

    [Wed Aug 19 22:34:09 2009] [debug] mpm_winnt.c(605): Parent: Sent 1 listeners to child 2712

    [Wed Aug 19 22:34:09 2009] [debug] mpm_winnt.c(564): Child 2712: retrieved 1 listeners from parent

    [Wed Aug 19 22:34:09 2009] [notice] Child 2712: Acquired the start mutex.

    [Wed Aug 19 22:34:09 2009] [notice] Child 2712: Starting 64 worker threads.

    [Wed Aug 19 22:34:09 2009] [notice] Child 2712: Starting thread to listen on port 80.

    zend_mm_heap corrupted

    [Wed Aug 19 22:37:07 2009] [notice] Parent: child process exited with status 1 -- Restarting.

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 22:37:07 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.10 configured -- resuming normal operations

    [Wed Aug 19 22:37:07 2009] [notice] Server built: Dec 10 2008 00:10:06

    [Wed Aug 19 22:37:07 2009] [notice] Parent: Created child process 18072

    [Wed Aug 19 22:37:07 2009] [debug] mpm_winnt.c(487): Parent: Sent the scoreboard to the child

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using xx.xx.xxx.xxx for ServerName

    [Wed Aug 19 22:37:08 2009] [notice] Child 18072: Child process is running

    [Wed Aug 19 22:37:08 2009] [info] Parent: Duplicating socket 296 and sending it to child process 18072

    [Wed Aug 19 22:37:08 2009] [debug] mpm_winnt.c(408): Child 18072: Retrieved our scoreboard from the parent.

    [Wed Aug 19 22:37:08 2009] [debug] mpm_winnt.c(605): Parent: Sent 1 listeners to child 18072

    [Wed Aug 19 22:37:08 2009] [debug] mpm_winnt.c(564): Child 18072: retrieved 1 listeners from parent

    [Wed Aug 19 22:37:08 2009] [notice] Child 18072: Acquired the start mutex.

  5. Hallo allerseits,

    ich betreibe auf meinem vServer (Win 2003 x64 Standard SP2) einen Apache 2.2.11 Webserver mit der PHP Version 5.2.10 und einen Mysql Server Version 5.1.37.

    Alles funktioniert wunderbar, bis auf PHP Scripte die eine Datenbankverbindung aufbauen.

    Wenn man einen solchen Script aufruft kommt die Fehlermeldung "Fehler: Verbindung unterbrochen".

    Dem Apache error-logfile kann man entnehmen das der Server jedes mal bei dem Aufruf des Scriptes neugestartet wird.

    Der Accesslog bleibt leer.

    Der Mysql-Connector ist in der php.ini eingetragen:

    [php_MYSQL]

    extension=php_mysql.dll

    Der MySQL server läuft ohne Probleme, per Konsole kommt man drauf.

    Die php_mysql.dll liegt im PHP/ext Verzeichnis und im Windows Systemverzeichnis und wird auch geladen (sonst würde er ja eine Fehlermeldung bringen).

    Version ist die zur PHP und MySQL passende.

    Systemvariablen sind korrekt gesetzt.

    Im HOSTNAME.err file im mysql/data Verzeichnis ist nichts relevantes zu finden..

    Hat irgendjemand eine Ahnung wo das Problem liegen könnte?

    Vielen Dank schon einmal im voraus!

  6. Ich hab mir die Funktion angeguckt und da steht drin dass sie true zurückgibt wenn ein weiterer Result-Set vorhanden ist und geht auf ihn weiter.

    Das wird auch in vielen Beispielen so verwendet aber ich probier deinen Vorschlag natürlich trotzdem gerne aus.

    Vielen Dank!

    *Edit: The operator != is undefined for the argument type(s) boolean, null sagt mir Eclipse wenn ich das einfüge.

    Hier mal die Beschreibung der Methode

    boolean java.sql.ResultSet.next() throws SQLException

    next

    boolean next()

    throws SQLException

    Moves the cursor froward one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.

    When a call to the next method returns false, the cursor is positioned after the last row. Any invocation of a ResultSet method which requires a current row will result in a SQLException being thrown. If the result set type is TYPE_FORWARD_ONLY, it is vendor specified whether their JDBC driver implementation will return false or throw an SQLException on a subsequent call to next.

    If an input stream is open for the current row, a call to the method next will implicitly close it. A ResultSet object's warning chain is cleared when a new row is read.

    Returns:

    true if the new current row is valid; false if there are no more rows

    Throws:

    SQLException - if a database access error occurs or this method is called on a closed result set

    Ich weis nicht ob ich das so schonmal erwähnt hatte:

    Das ganze läuft einmal durch beim zweiten mal bekommt er den Error.

  7. Hmm... ich sag dir eins:

    SAP-Entwicklung ist langweilig :D

    Wird aber sehr gut bezahlt (vor allem mit entsprechenden Referenzen).

    Allerdings läuft in der Richtung vieles nur mit absolviertem Studium...

    Hoffe ich konnte dir was helfen. Ich bin ABAP-Entwickler und bekomm von daher schon etwas mit was so im SAP Bereich läuft.

  8. Hi@all

    Erstmal der code:

    	SpaceMigrationTool() throws Exception{
    
    
    		// MySQL part----------
    
    		// declares the database connection
    
    		Connection conn = null;
    
    		Class.forName(DRIVER);
    
    
    
            // CONNECTION ---------------
    
            try{
    
            	try { //ends witch catch SQLException
    
    
                	//connecting...
    
        			conn = DriverManager.getConnection(dbHost
    
        												+dbName
    
        												+"?user="+dbUsr
    
        												+"&password="+dbPwd);
    
    
        			stmt = conn.createStatement();
    
    
    
    
        		    fillForumTable();
    
    
        		    System.out.println("Programmende");
    
    
    
        		    //end of everything that needs the MySQL connection conn
    
                } catch (SQLException ex) {
    
        			// handle any errores
    
        			// declares the PrintWriter "write"
    
                	do{
    
                		System.out.println("SQLException: " + ex.getMessage());
    
            			System.out.println("SQLState: " + ex.getSQLState());
    
            			System.out.println("VendorError: " + ex.getErrorCode());
    
                	}while(ex.getNextException()!=null);
    
    
    
        		}
    
            } finally {
    
                if (res != null) {
    
                    try {res.close();} catch (SQLException ex) {}
    
                    res = null;
    
                }
    
    
                if (stmt != null) {
    
                    try {stmt.close();}catch (SQLException ex) {}//do nothing
    
                    stmt = null;
    
                }
    
            	if(conn != null){
    
            		try{conn.close();}catch (SQLException ex){}
    
            	}
    
            }
    
    
    	}
    
    
    	protected ResultSet mysqlSel(String SQLSTATEMENT) throws Exception{
    
    		ResultSet rs;
    
    
    		if(stmt.execute(SQLSTATEMENT)){
    
    			rs = stmt.getResultSet();
    
    			return rs;
    
    		} else {
    
    			throw new Exception("SELECT Abfrage fehlgeschlagen. Ungültige Syntax oder keine Datenbankverbindung");
    
    		}
    
    	}//end of function mysqlSel
    
    
    	protected boolean mysqlInsert(String SQLSTATEMENT) throws SQLException{	
    
    		if(stmt.execute(SQLSTATEMENT)){
    
    			return true;
    
    		} else {
    
    			return false;
    
    		}
    
    	}//end of function mysqlInsert
    
    
    	protected boolean fillForumTable() throws Exception{
    
    		//try{
    
    		SQLSTMT = "SELECT title_clean, parentid FROM forum;";
    
    
    		//execute query
    
    	     	 ResultSet res = mysqlSel(SQLSTMT);
    
    
    	    	 ResultSetMetaData rsmd = res.getMetaData();
    
    	    	 int n = rsmd.getColumnCount();
    
    	    	 System.out.println("Anzahl der Felder: "+n);
    
    
    	    	 int lines=0;
    
    	    	 String[] resStr = new String[n+1];
    
    	    	 while(res.next()){
    
    	    		 sb.append("Datensatz "+lines+": ");
    
    	             for(int i=1; i<=n; i++ ){// Attention: first column with 1 instead of 0
    
    	            	 resStr[i] = res.getString(i);
    
    	            	 sb.append(resStr[i]+";");
    
    	             }
    
    	             SQLSTMT="INSERT INTO `spacequadrat`.`archv_forum` (`forumid` ,`title` ,`parent`) VALUES (NULL, '"+resStr[1]+"', '"+resStr[2]+"');";
    
    
    	            	 if(mysqlInsert(SQLSTMT)){
    
    	            		 sb.append("Eintrag fehlgeschlagen!!!!!!!!!!!\r\n");
    
    		             }else {
    
    		            	 sb.append("Erfolgreich eingetragen\r\n");
    
    		             }
    
    	             System.out.println(sb.toString());
    
    	             lines++;
    
    	           }
    
    	    	return true;
    
    	}

    Im Titel steht schon die Fehlermeldung:

    Hier mal etwas ausgabe:

    Anzahl der Felder: 2

    Datensatz 0: Intern;-1;Erfolgreich eingetragen

    SQLException: Operation not allowed after ResultSet closed

    SQLState: S1000

    VendorError: 0

    Fehler tritt bei while(res.next()) in fillForumTable auf

    Wie ihr sehr wird angemeckert das das ResultSet angeblich closed ist was aber an dieser Stelle überhaupt nicht sein darf weil while(res.next()) erfüllt sein müsste denn es gibt 57 Datensätze (Es sind auch im ResultSet 57 Rows angegeben).

    Wie ihr seht schliesse ich erst alles nachdem der Konstruktor durchgelaufen ist mit einem finally.

    Hat jemand eine Idee was ich falsch mache?

    Vielen Dank für eure Hilfe!

  9. Der Fehler tritt in der Zeile

    result[charIt][x]=userArray[i];

    auf, wie vermutet.

    Ich bekomme leider nur die Fehlermeldung "ArrayIndexOutOfBoundsException: 65".

    Ich nehme an wenn ich result[charIt][x] aufrufe wird für charIt der ASCII-Code von dem entsprechenden Buchstaben eingefügt.

    Denn an der Stelle 65 (dez) steht laut ASCII Tabelle, dass große "A" und das ist der erste Buchstabe des index-Arrays.

    Ich muss zugeben dass mich die Funktion die ich erstellt habe selbst leicht überfordert da ich ein relativer Neuling bin :upps .

    Bin auch gerne für Verbesserungsvorschläge offen und dankbar.

    Im übrigen ist der userArray bereits alphabetisch aufsteigend geordnet.

  10. Ich möchte einen Array erstellen in dem Benutzer nach Anfangsbuchstaben gruppiert abgespeichert werden:

        private String[][] create2DArray(String[] userArray, char[] index){
    
        	int i=0;
    
    
        	String[][] result;
    
    
        	for(int j=0;j<index.length;j++){
    
        		char charIt=index[j];
    
        		for(int x=0;userArray[i].charAt(0)==charIt; x++){
    
            		result[charIt][x]=userArray[i];
    
            		if(i<userArray.length){
    
            			i++;
    
            		} else {
    
            			break;
    
            		}
    
    
            	}
    
        	}
    
    
    
        	return result;
    
        }
    Leider möchte es nicht ganz so wie ich will.. und wenn ich den String result mit
    String[][] result = new String[index.length][20]

    initialisieren möchte bekomme ich ich eine ArrayIndexOutOfBoundsException.

    Im "index" char-Array stehen alle Buchstaben des Alphabets von A-Z

    Hat jemand für mich einen Vorschlag wie ich das Problem lösen kann?

  11. Hab mal in der Tabelle nachgeguckt und da stehen nur lokale Benutzer drin.

    in der my.cnf kann man auch ein paar Sachen umstellen und auch über bind-address 127.0.0.1 den Zugriff auf den localhost beschränken.

    FTP hab ich auf 2121 umgestellt.

    Jetzt muss ich mal alle meine Scripte durchgehen und dort den neuen Port eintragen..

    Danke für eure Hilfe!

  12. Danke für die Tipps.

    Ich denke ich werde zumindest einmal den Port umlegen.

    Der Tipp mit MySQL ist auch gut, wo stell ich das ein?

    Die Attacken sind verteilt also kommen höchstens 2-5 Anfragen von verschiedenen IP Adressen aus allen möglichen Bereichen allerdings immer aus östlicheren Gefilden (hab mal einige IP's im browser eingegeben da kamen Seiten aus Russland, Ukraine, China sogar Kosovo) ...

  13. Hallo,

    ich habe gestern mal zufällig in die Konsole von meinem FTP Server (FileZilla) geguckt und mir ist aufgefallen, dass von diversen IP's versucht wird sich mit verschiedenen Benutzernamen wie "admin", "administrator", "newuser" etc.. m it verschiedenen Passwörtern einzuwählen.

    Glücklicherweise wähle ich 1. sichere Passwörter und verwende 2. keine derartigen Benutzernamen.

    Allerdings häuft sich in letzter Zeit die Zahl der Abstürze meines v-Servers und die Performance wird zunehmend schlechter.

    Es könnte also in Zusammenhang mit diesen Dictionary-attacks liegen, zumal ich nich weis, welche Dienste ausser dem FTP noch betroffen sind.

    Ansonsten läuft noch ein Mailserver (Mercury Mail) und ein Apache 2 Webserver und ein MySQL Datenbankserver (ein komplettes XAMPP-Paket) ausserdem ein Teamspeak 2 Server.

    Ich ziehe etwas wie ein "Intrusion detection system" in Betracht, habe allerdings nicht viel Ahnung davon und weis nicht wie diese Programme eingreifen bzw was sie erkennen und was nicht.

    Falls das die richtige Lösung wäre: Könnte mir jemand ein IDS für Windows Server 2003 (Enterprise) vorschlagen, oder habt ihr andere Lösungsvorschläge.

    Danke schon einmal im vorraus für die Hilfe.

  14.     String sName = req.getParameter("nachname");
    
            char anfangsBuchstabe= sName.charAt(0);
    
    	char anfBuNew = anfangsBuchstabe;
    
    	anfBuNew = Character.toUpperCase(anfangsBuchstabe);
    
    	String a = Character.toString(anfangsBuchstabe);
    
    	String b = Character.toString(anfBuNew);
    
    	sName = sName.replaceFirst(a, ;[/code]

    naja gut habs doch selbst geschafft... :D

  15. Hallo,

    ich möchte in einem String der einen Namen enthält den ersten Buchstaben durch den selbigen nur in Großschreibung ersetzen.

    Bisher habe ich

    	String name= "keineahnung";
    
    	char anfangsBuchstabe= anfang.charAt(0);
    
    	Character.toUpperCase(name);

    Die Frage ist jetzt wie ich den ersten Buchstaben wegschneiden kann bzw den Rest des Strings isolieren kann um die beiden Teile dann zusammenzufügen.

    Hab gegooglet aber bisher nur Gefunden wie man nach einer bestimmten Stelle abschneidet, also der Rest wegfällt und das möchte ich ja nicht (substring).

    Danke schon einmal für die Hilfe.

  16. Hatte auch mal einen Outlook 2003 termin bekommen aber es nicht geschafft ihn in mein Lightning zu bekommen.

    Er hat zwar irgendwie bemerkt das es ein Termineintrag werden soll, ihn aber nicht übernommen.

    Ich rate zu: Abwarten bis TB 3 offiziell kommt oder TB 3 (Shredder -Alpha 3) runterladen und testen.

    In Thunderbird 3 wird ja Lightning kein Plugin mehr sondern ein Bestandteil des Programms sein, also kann man da sicher auf Verbesserungen hoffen.

    Kannst das Problem ja auch in den Mozilla Helpgroups für Thunderbird posten.

    *Edit: news://news.mozilla.org:119/mozilla.dev.apps.thunderbird

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...