SA-MP Forums Archive
MYSQL Connect - Error - 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: MYSQL Connect - Error (/showthread.php?tid=626884)



MYSQL Connect - Error - DerickClark - 21.01.2017

Код:
[11:59:21] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'root'@'localhost' (using password: YES)'
[11:59:21] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'root'@'localhost' (using password: YES)'
[11:59:21] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'root'@'localhost' (using password: YES)'
[11:59:21] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'root'@'localhost' (using password: YES)
pawn Код:
#define    MYSQL_HOST        "127.0.0.1"
#define    MYSQL_USER        "root"
#define    MYSQL_DATABASE    "tw_server"
#define    MYSQL_PASSWORD    "admin"


pawn Код:
public OnGameModeInit()
{
    mysql = mysql_connect("127.0.0.1", "root", "admin", "tw_server");
}



Re: MYSQL Connect - Error - Yaa - 21.01.2017

are u using xaamp or something like that ?

then remove password

PHP код:
#define    MYSQL_HOST        "127.0.0.1"
#define    MYSQL_USER        "root"
#define    MYSQL_DATABASE    "tw_server"
#define    MYSQL_PASSWORD    "" 
PHP код:
public OnGameModeInit()
{
    
mysql mysql_connect("127.0.0.1""root""""tw_server");




Re: MYSQL Connect - Error - DerickClark - 21.01.2017

I'm using xampp but in the warning folder it had said

Код:
[12:08:22] [plugins/mysql] mysql_connect: no password specified
does it means something?


Re: MYSQL Connect - Error - Yaa - 21.01.2017

try login using phpadmin


Re: MYSQL Connect - Error - KNIGHT786 - 21.01.2017

try to do like this
#define SQL_HOST "127.0.0.1"
#define SQL_USER "root"
#define SQL_PASS "admin"
#define SQL_DB "tw_server"//

public OnGameModeInit()
{
profileStuff();
connection = mysql_init(LOG_ONLY_ERRORS, 1);

mysql_connect("127.0.0.1", "root", "admin", "tw_server", connection, 1);
}
but make sure that u have change local host pass to admin


Re: MYSQL Connect - Error - Yaa - 21.01.2017

Quote:
Originally Posted by KNIGHT786
Посмотреть сообщение
try to do like this
#define SQL_HOST "127.0.0.1"
#define SQL_USER "root"
#define SQL_PASS "admin"
#define SQL_DB "tw_server"//

public OnGameModeInit()
{
profileStuff();
connection = mysql_init(LOG_ONLY_ERRORS, 1);

mysql_connect("127.0.0.1", "root", "admin", "tw_server", connection, 1);
}
but make sure that u have change local host pass to admin
what the hell

Kill me please


Re: MYSQL Connect - Error - khRamin78 - 04.10.2018

Quote:
Originally Posted by KNIGHT786
Посмотреть сообщение
try to do like this
#define SQL_HOST "127.0.0.1"
#define SQL_USER "root"
#define SQL_PASS "admin"
#define SQL_DB "tw_server"//

public OnGameModeInit()
{
profileStuff();
connection = mysql_init(LOG_ONLY_ERRORS, 1);

mysql_connect("127.0.0.1", "root", "admin", "tw_server", connection, 1);
}
but make sure that u have change local host pass to admin
best answer ever


Re: MYSQL Connect - Error - UFF - 04.10.2018

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
I'm using xampp but in the warning folder it had said

Код:
[12:08:22] [plugins/mysql] mysql_connect: no password specified
does it means something?
Код:
public OnGameModeInit()
{
    mysql = mysql_connect("localhost", "root", "admin", " "); 
}
try this.