MYSQL is not Loading/Saving.
#6

Quote:
Originally Posted by Cypress
Посмотреть сообщение
Show the code which makes the connection to your database along with the defines.
Here is the code with 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:
Originally Posted by venomlivno8
Посмотреть сообщение
Please paste us text from the mysql error log in "logs/plugins/mysql.txt"
here is 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
Thank you for reply.
Reply


Messages In This Thread
MYSQL is not Loading/Saving. - by GeorgeMcReary - 14.03.2017, 10:28
Re: MYSQL is not Loading/Saving. - by Cypress - 14.03.2017, 11:11
Re: MYSQL is not Loading/Saving. - by GeorgeMcReary - 14.03.2017, 11:29
Re: MYSQL is not Loading/Saving. - by Cypress - 14.03.2017, 12:34
Re: MYSQL is not Loading/Saving. - by venomlivno8 - 14.03.2017, 12:35
Re: MYSQL is not Loading/Saving. - by GeorgeMcReary - 14.03.2017, 13:29
Re: MYSQL is not Loading/Saving. - by ManIsHere - 14.03.2017, 16:34
Re: MYSQL is not Loading/Saving. - by GeorgeMcReary - 15.03.2017, 09:27

Forum Jump:


Users browsing this thread: 1 Guest(s)