SA-MP Forums Archive
MySQL Issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL Issue (/showthread.php?tid=217643)



MySQL Issue - Criss_Angel - 28.01.2011

I made a pawno script of connecting to my sql server at my ip xx.xxx.xxx like this:
pawn Код:
mysql_init();
mysql_connect("IP","User","Pass","SQLDB");
I run it from my PC, but it says access denied from user@MyIP :S


Re: MySQL Issue - Criss_Angel - 28.01.2011

Help Wanted, Assistance Wanted. <3


Re: MySQL Issue - playbox12 - 28.01.2011

pawn Код:
// somewhere ontop of your script, under the includes.
#define MyHOST "localhost" // you said it runs on your PC so keep it like this
#define MyUSER "root" // change it if you have a user account for mysql; if you don't understand it leave it like this
#define MyPASS "" // password change it if you have one; if you don't understand leave it like this
#define MyDB "SQLDB" // change this if your database name is different, from what you have provided

// under OnGameModeInit
mysql_init();
mysql_connect(MyHOST, MyUSER , MyPASS, MyDB );
Also judging from the code, I guess you use strickenkids plugin. I strongly advice to use the plugin from G'Stylezz, as I experienced server crashes with strickenkids.

(the error means that you are not authorized to acces the mySQL database, this can either be caused by providing the wrong username and or password in the Pawn script. Or because you specified the wrong database).


Re: MySQL Issue - Criss_Angel - 28.01.2011

No, I run the server.exe from my PC, but the SQL is on my website you see.hence the IP


Re: MySQL Issue - dice7 - 28.01.2011

Did you create a user and set him so his hostname can be anything ?


Re: MySQL Issue - Criss_Angel - 28.01.2011

user for my cpanel is jminixah, directory is home/jminixah/ But the user for my Database is Rayyan.


Re: MySQL Issue - Criss_Angel - 28.01.2011

Help Please?!


Re: MySQL Issue - Criss_Angel - 28.01.2011

I run the beta pawn script from my PC with IP my.ip.PC , My Script connects to the MySQL Server (same as my website) which is at the IP my.ip.Serv.On my Server.exe which is running from my PC, it says acces denied for jminixah@my.ip.PC.

Please Help, I dont have a host atm and i cant pay since no cash.


Re: MySQL Issue - Kaylux - 28.01.2011

pawn Код:
// somewhere ontop of your script, under the includes.
#define MyHOST "ip" // Server IP
#define MyUSER "root" // change it to a user account for mysql
#define MyPASS "" // Password
#define MyDB "SQLDB" // Database name

// under OnGameModeInit
mysql_init();
mysql_connect(MyHOST, MyUSER , MyPASS, MyDB );
Also, alot of websites block incoming and outgoing MySQL traffic outwith it's own system.


Re: MySQL Issue - Criss_Angel - 28.01.2011

in cPanelX where it says Database (Add User), i added a user called Rayyan and password MyPass, I enter that info there?