Moin ihr Brotfische,
ich habe von nem Kollegen ein Script bekommen und sollte da mal drüber schauen, bisschen editieren und flott machen.
Um das Script zu testen muss natürlich auch die Datenbank dabei sein. Also XAMPP angemacht Apache und MySQL gestartet.
Noch schnell auf Phpmyadmin einen Benutzer erstellt
Benutzername: samp
Host: Jeder Host: %
Passwort: 12345 (bsp.)
Alle Rechte gesetzt.
im Script die Daten angepasst:
#define dbhost "localhost"
#define dbuser "samp"
#define dbdb "***"
#define dbpw "12345"
mysql = mysql_init(LOG_ONLY_ERRORS);
mysql_save = mysql_init(LOG_ONLY_ERRORS);
mysql_car = mysql_init(LOG_ALL);
mysql_load = mysql_init(LOG_ONLY_ERRORS);
// Connect to the database.
mysql_connect(dbhost, dbuser, dbpw, dbdb, mysql,1);
mysql_connect(dbhost,dbuser,dbpw,dbdb,mysql_save,1);
mysql_connect(dbhost,dbuser,dbpw,dbdb,mysql_car,1);
mysql_connect(dbhost,dbuser,dbpw,dbdb,mysql_load,1);
dummyQuery();
Script compiliert und Server gestartet.
Beim Start schmeißt mir die Konsole Errors entgegen, die ich auch in der sqllog datei finde.
[Fri Jan 09 09:16:40 2015] -------------------------
[Fri Jan 09 09:16:40 2015] Logging Started
[Fri Jan 09 09:16:40 2015] -------------------------
[Fri Jan 09 09:16:41 2015] Function: mysql_init executed with result: "2".
[Fri Jan 09 09:16:41 2015] Error (0): Failed to connect. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (1): Failed to connect. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (2): Failed to connect. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (3): Failed to connect. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_query called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (1): Function: mysql_query called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (2): Function: mysql_query called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (3): Function: mysql_query called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_query called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_free_result called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_query called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_free_result called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_query called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_store_result called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
[Fri Jan 09 09:16:41 2015] Error (0): Function: mysql_fetch_field called when not connected to any database. Access denied for user 'samp'@'localhost' (using password: YES).
Alles anzeigen
Die unteren 6 Zeilen wiederholen sich bis zum ende des Logs also ca. 2000 mal.
Mysql Plugin und include von StrickenKid v2.1
Da ich noch Navicat aufm PC habe da mal direkt die Verbindung getestet:
1045 - Access denied for User "samp"@"localhost" (using password: YES)
Heißt also ich habe kein Passwort oder ein falsches Passwort eingegeben.
Da ich aber inzwischen wirklich schon 1234567 ausprobiert habe, kann das unmöglich sein.
Warum bekomme ich die Errors und wie bekomme ich jetzt ne Verbindung hin?
Greez.