MySQL R40 Can't Connect
#1

Hello everyone,

I was using the old version of BlueG's MySQL (r20) and I had no problem with connection or anything. But i decided to update MySQL version. And it came with connection problem. I'm using that code;

Код:
new MySQL:mysqlConn;

public OnGameModeInit() 
{ 
	print("[MySql] Connecting to database...");

	mysqlConn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS, SQL_DATABASE);
	mysql_log(ALL); 

	if (mysql_errno(mysqlConn) != 0)
	{
		print("[MySql] Connected!");
	}
	else
	{
		print("[MySql] Connection Failed!");
	}
	
    return 1; 
}
When I start the server, it logs "Connection failed!". But with the older versions of MySQL plugin, I have no problem.

What could be causing this?
Reply
#2

Question

Have you made sure that all the details are correct, and since updating have you changed any mysql settings that relate to the user of the mysql account?

Also what does the mysql log say?
Reply
#3

https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_errno

If it returns 0, there are no errors - you have it the other way around.
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_errno

If it returns 0, there are no errors - you have it the other way around.
Ohh thank you so much. I've been eating myself for days to find that freaking error. Whereas there was no errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)