SA-MP Forums Archive
Problem with connecting to the mysql DB - 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)
+--- Thread: Problem with connecting to the mysql DB (/showthread.php?tid=625845)



Problem with connecting to the mysql DB - fastayko - 07.01.2017

new MySQL:g_Sql, error;
g_Sql = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
error = mysql_errno();
if (!error) SendClientMessage(playerid, COLOR_RED, "Successfully connected to the database.");
else
{
format(string, sizeof(string), "Failed to connect to the database. Error: %d", error);
SendClientMessage(playerid, COLOR_RED, string);
}
i always get error : 1045
mysql_host, mysql_user, mysql_database, mysql_password are correct


Re: Problem with connecting to the mysql DB - Konstantinos - 07.01.2017

https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_connect

3rd parameter is the password and 4th the database in R40+