Failed to connect for user 'root'@'localhost'
#1

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3e-R2, ©2005-2012 SA-MP Team

[18:53:39] filterscripts = ""  (string)
[18:53:39] 
[18:53:39] Server Plugins
[18:53:39] --------------
[18:53:39]  Loading plugin: mysql
[18:53:39]  SA:MP MySQL Plugin v2.1.1 Loaded.
[18:53:39]   Loaded.
[18:53:39] [MySQL] Thread running. Threadsafe: Yes.
[18:53:39]  Loaded 1 plugins.

[18:53:39] 
[18:53:39] Filterscripts
[18:53:39] ---------------
[18:53:39]   Loaded 0 filterscripts.

[18:53:39] [MySQL] Error (0): Failed to connect. Access denied for user 'root'@'localhost' (using password: YES).
[18:53:39] [MySQL] Error (0): Function: mysql_ping called when not connected to any database. Access denied for user 'root'@'localhost' (using password: YES).
[18:53:39] MySQL connection to sanfierro failed
[18:53:39] Number of vehicle models: 0
Reply
#2

That means your connection was unsuccessful.

May be wrong password/not enough premissions.
Reply
#3

The password is correct, so I don't know what to do.
Reply
#4

Are you sure you're using mysql_connect properly? Can you show us code?
Reply
#5

pawn Код:
#include <a_samp>
#include <mysql>
#include <zcmd>

#define MySQL_hostname "localhost"
#define MySQL_username "root"
#define MySQL_password ""
#define MySQL_database "sanfierro"

main() {}

public OnGameModeInit()
{
    mysql_init();
    mysql_connect("127.0.0.1","root","sanfierro","");
    if(mysql_ping()) printf("MySQL connection to %s successful",MySQL_database);
    else printf("MySQL connection to %s failed",MySQL_database);
    return 1;
}

public OnGameModeExit()
{
    mysql_close();
    return 1;
}
Reply
#6

Quote:

Access denied for user 'root'@'localhost'

Either you are using an incorrect password, or attempting to connect to a user who can only accept connections from a particular location (i.e. a specific IP address).
Reply
#7

How do I check which locations it will accept from?
Reply
#8

If you use phpMyAdmin, you can log in via the root account and click on the "users" tab. It will show you next to each user something like "localhost" or "@". The @ would mean that it will accept connections from anywhere.

localhost means it only accepts connections from localhost; although I don't believe this includes 127.0.0.1 on Windows Vista/7.
Reply
#9

I can't find a privileges tab anywhere.
Reply
#10

I don't see what the problem is to why it can't connect. Can someone who knows what they're talking about please help?

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)