Error (0): Failed to connect. Access denied for user 'samp'@'localhost' (using password: YES).
#1

Hello Guys, I have this Problem atm: Error (0): Failed to connect. Access denied for user 'samp'@'localhost' (using password: YES).
But the Code is:
#include <a_samp>
#include <mysql>
#include <zcmd>
#include <sscanf2>
#include <data>

#define mysql_host "localhost"
#define mysql_user "root"
#define mysql_password ""
#define mysql_database "db"

new MySQL:mysql;
new field[128];

#define mysql_fetch_float(%0,%1) mysql_fetch_field(%0,field); \
%1=floatstr(field)
#define mysql_fetch_string(%0,%1) mysql_fetch_field(%0,%1)
#define mysql_fetch_int(%0,%1) mysql_fetch_field(%0,field); \
%1=strval(field)

enum PlayerInfo
{
ID,
Nick[24],
pAdmin,
pMoney,
pKills,
pDeaths,
pScore,
IP[16],
Logged,
IsRegistered
};
new pInfo[MAX_PLAYERS][PlayerInfo];
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

public OnGameModeInit()
{
mysql = mysql_init(LOG_ALL); // Tells sql to log all mysql features used in the script
new Connection = mysql_connect(mysql_host,mysql_user,mysql_database ,mysql_password, mysql);
if(Connection)
{
new dest[200];
mysql_stat(dest);
printf(dest);
printf(">> MySQL connection successfully initialized");
}
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

When I use a password with a new User I just registred it wont work either. Does somebody know, how I can change it that it doesnt use a password? The Script is exactly like this (well the following part is missing in this post, but this is the beginning).

Greets.
Johannes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)