14.03.2017, 13:29
Quote:
Show the code which makes the connection to your database along with the defines.
|
Код:
//defines #define mysql_host "localhost" //Has to be a string #define mysql_user "Kudo" //Has to be a string #define mysql_pass "abcdmysql" //There is none for wamp unless you set one. #define mysql_db "myrp" //Has to be a string //OnFilterScriptInit public OnFilterScriptInit() { print("Custom Tree FS - Loaded"); new MySQLOpt: option_id = mysql_init_options(); mysql_set_option(option_id, AUTO_RECONNECT, true); // it automatically reconnects when loosing connection to mysql server for(new i; i < MAX_TREES; i++) { TreeData[i][treeObjID] = TreeData[i][treeTimer] = -1; TreeData[i][treeLabel] = Text3D: -1; } for(new i; i < MAX_LOGS; i++) { LogData[i][logObjID] = LogData[i][logTimer] = -1; LogData[i][logLabel] = Text3D: -1; } for(new i; i < MAX_VEHICLES; i++) for(new x; x < LOG_LIMIT; x++) LogObjects[i][x] = -1; foreach(new i : Player) Player_Init(i); mysql_connection = mysql_connect(mysql_host, mysql_user, mysql_db, mysql_pass); if (mysql_connection == MYSQL_INVALID_HANDLE || mysql_errno(mysql_connection) != 0) { print("MySQL connection failed"); return 1; } print("MySQL connection is successful."); new query[256], loadtrees[256]; mysql_format(mysql_connection, query, sizeof(query), "CREATE TABLE IF NOT EXISTS 'trees' (ID INT AUTO_INCREMENT, ObjID INT, PosX FLOAT, PosY FLOAT, PosZ FLOAT, RotX FLOAT, RotY FLOAT, RotZ FLOAT)"); mysql_tquery(mysql_connection, query, "OnTableCreate"); mysql_format(mysql_connection, loadtrees, sizeof(loadtrees), "SELECT * FROM 'trees'"); mysql_tquery(mysql_connection, loadtrees, "LoadTrees", "i",sizeof(TreeData)); mysql_log(ALL); return 1; }
Quote:
Please paste us text from the mysql error log in "logs/plugins/mysql.txt"
|
Код:
[14/03/2017 18:47:14] [ERROR] mysql_connect: handle error: no database specified [14/03/2017 18:47:15] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'Kudo'@'localhost' (using password: YES)' [14/03/2017 18:47:15] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'Kudo'@'localhost' (using password: YES)' [14/03/2017 18:47:15] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'Kudo'@'localhost' (using password: YES)' [14/03/2017 18:47:15] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'Kudo'@'localhost' (using password: YES)' [14/03/2017 18:47:16] [ERROR] cache_get_row_count: no active cache [14/03/2017 18:47:16] [ERROR] cache_get_row_count: no active cache