MySQL help
#1

Hello everyone,

I've run my gamemode, I've scripted it like two years ago, it uses the include file "mysql" (not a_mysql), and the plugin mysql.dll

When I run the server on my localhost, it says: Access denied for 'root'@'localhost' ....

Here's OnGameModeInit callback:

PHP Code:
public OnGameModeInit()
{
    
connection mysql_init(LOG_ONLY_ERRORS1);
    
     
mysql_connect("localhost""root""""cnr"connection1);
     return 
1;

Reply
#2

Code:
 mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
Something like that, ( https://sampforum.blast.hk/showthread.php?tid=574714 )
Reply
#3

The "" in your function is the password. If your access is being denied, it means that there is a password preventing you from entering the database. The password has to be user's password, in your case, root's password.
Reply
#4

try this
PHP Code:
public OnGameModeInit() 

    
connection mysql_init(LOG_ONLY_ERRORS1); 
     
     
mysql_connect("localhost""root""cnr""",  connection1); 
     return 
1

it's still using the a_mysql just renamed since the functions look the same. Well

just try that

if you are not using a localhost on your local computer such WAMPserver or XAMPP

then try asking your remote mysql host to tell you what the password is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)