MySQL can't connect, beacuse of access denied.
#1

PLEASE READ!
I have downloaded the StrickenKid MySQL library and have properly installed it (copied the files, added to plugins and included in my code)
I am trying to connect to my MySQL server (started using XAMPP).My username is root and there is no pass (blank field).
Код:
[Mon Dec 09 21:10:07 2013] -------------------------
[Mon Dec 09 21:10:07 2013]      Logging Started
[Mon Dec 09 21:10:07 2013] -------------------------
[Mon Dec 09 21:10:07 2013] Error (0): Failed to connect. Access denied for user 'root'@'localhost' (using password: YES).
The code:
Код:
	new MySQL:connection = mysql_init(LOG_ONLY_ERRORS, 1);
	mysql_connect("127.0.0.1", "root", "", "cnr", connection, 1);
	SetGameModeText("Cops And Robbers");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
I have already created the DB.
Reply
#2

Код:
[Mon Dec 09 21:10:07 2013] Error (0): Failed to connect. Access denied for user 'root'@'localhost' (using password: YES).
>> Using password : Yes,
You use password in your connection
Код:
mysql_connect("127.0.0.1", "root", "add your password here!", "cnr", connection, 1);//missing password!
Correct usage
Код:
mysql_connect(mysqlhost, mysqluser, mysqlpassword, mysqldatabase, mysql);
Reply
#3

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
You use password in your connection
Код:
mysql_connect("127.0.0.1", "root", "add your password here!", "cnr", connection, 1);//missing password!
Correct usage
Код:
mysql_connect(mysqlhost, mysqluser, mysqlpassword, mysqldatabase, mysql);
I already have written that there is no password. It's just a blank field. I also created new user with password and tried to run it but it doesn't work with password too.
Reply
#4

Okay. Now i created password just for test (my password is 123456). I'm able to log via HeidiSQL with username root and password 123456, but my script still shows that the access was denied.
Quote:

public OnGameModeInit()
{
new MySQL:connection = mysql_init(LOG_ONLY_ERRORS, 1);
mysql_connect("127.0.0.1", "root", "123456", "cnr", connection, 1);
SetGameModeText("Cops And Robbers");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

PS: Fixed it. It was because of my MySQL password. Maybe this plugin doesn't support blank passwords
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)