SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 06/02/2014, 05:26 PM   #1
iJohann3s
Little Clucker
 
Join Date: Feb 2014
Posts: 6
Reputation: 0
Default Error (0): Failed to connect. Access denied for user 'samp'@'localhost' (using password: YES).

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.
iJohann3s is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL can't connect, beacuse of access denied. TheDeath Scripting Help 3 09/12/2013 07:23 PM
Access denied for user 'root'@'localhost' (using password: YES). munsee Server Support 7 29/06/2013 05:10 AM
My SQL " Access denied for root@localhost mahony0509 Scripting Help 3 24/04/2013 09:12 PM
Failed to connect for user 'root'@'localhost' Noles2197 Scripting Help 9 26/01/2013 04:25 PM


All times are GMT. The time now is 07:10 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.