mysql_connect no access
#1

Hello, I got a problem, it says on the server-samp file:

Code:
[MySQL] Error (0): Failed to connect. Access denied for user 'root'@'localhost' (using password: YES).
Here's the thing that I have on OnGameModeInit:
PHP Code:
connection mysql_init(LOG_ONLY_ERRORS1);
    
mysql_connect("localhost""root"" ""ccnr"connection1); 
What is wrong with it?!
Reply
#2

well. Is this MySQL From your pc? if no ? then your code should be like that
Quote:

mysql_connect("localhost", "root", "password", "ccnr", connection, 1);

Reply
#3

Quote:
Originally Posted by Younes44
View Post
well. Is this MySQL From your pc? if no ? then your code should be like that
Mate, yeah, it's on my PC, I want to run it into my localhost IP, not on a host.
Reply
#4

Quote:
Originally Posted by Sunehildeep
View Post
Have you installed wamp/xamp on your PC?
this should work..
Reply
#5

Quote:
Originally Posted by Younes44
View Post
this should work..
Of course, I have another server working on MySQL and when I run it on localhost and works well, but this one ain't working.
Reply
#6

I edited the database and host and password and matched it with the host one, then uploaded it to the host and I started the server, and same exact error shows up again.

Help!
Reply
#7

Run this query on your MySQL server (Use root):
Code:
GRANT ALL PRIVILEGES ON *.* TO 'your_user'@'your_host/localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
Reply
#8

Quote:
Originally Posted by Lordzy
View Post
Run this query on your MySQL server (Use root):
Code:
GRANT ALL PRIVILEGES ON *.* TO 'your_user'@'your_host/localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
I don't know where is root and where to write this and where to run it..?
Reply
#9

This means you can't access it unless you're running it on the same machine the mysql is hosted. Cuz I get this error when I try to get a mysql connection of another machine. So use remote mysql or get SQL from http://mysql.db4free.net and try.
Reply
#10

Don't rely on connecting remotely, it's slow.

Quote:
Originally Posted by Ahmed21
View Post
I don't know where is root and where to write this and where to run it..?
Login as root on phpMyAdmin and execute this query.

PS : Are you using any free/paid host as shown in your signature? Because you'll have to contact your support team instead.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)