SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 21/07/2017, 02:47 PM   #1
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Problem connection mysql r41-3

Hello guys, i have a problem. This problem is connection to localhost.
I have 1 warning(in warning log(mysql)) and 4 errors(in errors log(mysql))
Warning:
Code:
[17:31:15] [plugins/mysql] mysql_connect: no password specified (D:\GM\gamemodes\GM.pwn:23970 -> D:\pawno S\pawno\include\afk.inc:73 -> D:\pawno S\pawno\include\YSI\y_hooks/impl.inc:483)
I don't have a password, because i use it localhost.
And errors:
Code:
[17:31:15] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2013 'Lost connection to MySQL server at 'reading authorization packet', system error: 10060'
[17:31:15] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2013 'Lost connection to MySQL server at 'reading authorization packet', system error: 10060'
[17:31:15] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2013 'Lost connection to MySQL server at 'reading authorization packet', system error: 10060'
[17:31:15] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2013 'Lost connection to MySQL server at 'reading authorization packet', system error: 10060'
I updated the plugins and logs to R41-3
Connection code
Code:
handle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);

Details for mysql_host, etc:

#if defined Server1
	#define MYSQL_HOST 		""
	#define MYSQL_USER 		""
	#define MYSQL_PASS 		""
	#define MYSQL_DB		""
#endif
#if defined Server2
	#define MYSQL_HOST 		"localhost"
	#define MYSQL_USER 		"root"
	#define MYSQL_PASS 		""
	#define MYSQL_DB		"testx"
#endif
skuller12 is offline   Reply With Quote
Old 21/07/2017, 06:19 PM   #2
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: Problem connection mysql r41-3

UP!!
skuller12 is offline   Reply With Quote
Old 22/07/2017, 06:44 AM   #3
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: Problem connection mysql r41-3

UP, I put it OnQueryError and I have errors:

Errors:
Code:
[19:02:18] Error ID: 2013 | Callback: LoadCars
[19:02:18] Error: Lost connection to MySQL server at 'reading authorization packet', system error: 10060 | Query: SELECT * FROM `cars`
And function:
Code:
mysql_tquery(haft, "SELECT * FROM `cars`", "LoadCars", "");
skuller12 is offline   Reply With Quote
Old 23/07/2017, 05:22 AM   #4
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: Problem connection mysql r41-3

UP!!
skuller12 is offline   Reply With Quote
Old 24/07/2017, 06:42 AM   #5
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: Problem connection mysql r41-3

UP!!
skuller12 is offline   Reply With Quote
Old 24/07/2017, 07:19 AM   #6
AjaxM
Big Clucker
 
AjaxM's Avatar
 
Join Date: May 2016
Posts: 180
Reputation: 29
Default Re: Problem connection mysql r41-3

Try this.

PHP Code:
handle mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_PASSMYSQL_DB);

Details for mysql_hostetc:

#if defined Server1
    #define MYSQL_HOST         ""
    #define MYSQL_USER         ""
    #define MYSQL_PASS         " "
    #define MYSQL_DB        ""
#endif
#if defined Server2
    #define MYSQL_HOST         "localhost"
    #define MYSQL_USER         "root"
    #define MYSQL_PASS         " " // SPACE IF NO PASS
    #define MYSQL_DB        "testx"
#endif 
Also, why you have not filled up MYSQL_HOST, MYSQL_USER, MYSQL_DB and MYSQL_PASS in Server1? It's totally unnecessary, remove the whole of Server1.
__________________
Website | Forums| IP: 51.255.215.208:7817
AjaxM is offline   Reply With Quote
Old 24/07/2017, 08:44 AM   #7
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: Problem connection mysql r41-3

Server1 is for host, server2 is for localhost

Edit:

That's the same thing I do, the same problems
skuller12 is offline   Reply With Quote
Old 24/07/2017, 09:06 AM   #8
Xeon™
Banned
 
Join Date: Jul 2017
Location: Earth
Posts: 457
Reputation: 96
Default Re: Problem connection mysql r41-3

Quote:
Originally Posted by skuller12 View Post
UP, I put it OnQueryError and I have errors:

Errors:
Code:
[19:02:18] Error ID: 2013 | Callback: LoadCars
[19:02:18] Error: Lost connection to MySQL server at 'reading authorization packet', system error: 10060 | Query: SELECT * FROM `cars`
And function:
Code:
mysql_tquery(haft, "SELECT * FROM `cars`", "LoadCars", "");
can you share with us your LoadCars() callback?
Xeon™ is offline   Reply With Quote
Old 24/07/2017, 09:18 AM   #9
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: Problem connection mysql r41-3

Code:
function LoadCars()
{
	new Personal_Vehicles = cache_num_rows(), id;
	for(new i = 0; i < Personal_Vehicles; i++)
	{
		cache_get_value_name_int(i, "ID", id);
		cache_get_value_name_int(i, "ID", C_DATA[id][cSQLID]);
		cache_get_value_name_int(i, "UserID", C_DATA[id][cUserID]);
		cache_get_value_name(i, "Owner", C_DATA[id][cOwner], MAX_PLAYER_NAME);
		cache_get_value_name_int(i, "Model", C_DATA[id][cModel]);
		cache_get_value_name_int(i, "Color1", C_DATA[id][cColors][0]);
		cache_get_value_name_int(i, "Color2", C_DATA[id][cColors][1]);
		cache_get_value_name_float(i, "PosX", C_DATA[id][cPos][0]);
		cache_get_value_name_float(i, "PosY", C_DATA[id][cPos][1]);
		cache_get_value_name_float(i, "PosZ", C_DATA[id][cPos][2]);
		cache_get_value_name_float(i, "PosA", C_DATA[id][cPos][3]);
		cache_get_value_name(i, "Plate", C_DATA[id][cPlate], 10);
		cache_get_value_name(i, "CarName", C_DATA[id][cDesc], 30);
		cache_get_value_name_float(i, "KM", C_DATA[id][cKM]);
		for(new m = 0; m != 17; m++)
		{
			format(gString, 8, "Mod%d", m);
			cache_get_value_name_int(i, gString, C_DATA[id][cMods][m]);
		}
		cache_get_value_name_int(i, "PaintID", C_DATA[id][cPaintID]);
		cache_get_value_name_int(i, "Owned", C_DATA[id][cOwned]);
		cache_get_value_name_int(i, "Locked", C_DATA[id][cLock]);
		cache_get_value_name_int(i, "Days", C_DATA[id][cDays]);
		cache_get_value_name_int(i, "Fuel", C_DATA[id][cFuel]);
		cache_get_value_name_int(i, "Insurance", C_DATA[id][cInsurance]);
		cache_get_value_name_int(i, "Price", C_DATA[id][cPrice]);
		cache_get_value_name_int(i, "Neon", C_DATA[id][cNeon]);
		cache_get_value_name_int(i, "Spawned", C_DATA[id][cSpawned]);
		if(C_DATA[id][cSpawned] != 0) C_DATA[id][cSpawned] = 0, cUpdate(id, cSpawnedx);

		Total_P_Vehs = id;
	}
}
skuller12 is offline   Reply With Quote
Old 24/07/2017, 09:25 AM   #10
Xeon™
Banned
 
Join Date: Jul 2017
Location: Earth
Posts: 457
Reputation: 96
Default Re: Problem connection mysql r41-3

hmm, the callback is seems to be fine can you disable your firewall and try again? also what's MySQL Server are u using? "XAMPP" or ..?
Xeon™ 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 connection problem. GuitarMan Scripting Help 2 24/11/2016 06:30 PM
Mysql connection problem radiobizza Scripting Help 3 22/09/2016 04:34 AM
MySQL connection problem. Glenn332 Scripting Help 22 30/01/2015 09:39 PM
[MySql]Connection Problem Rohan_Ubhare Scripting Help 1 25/01/2013 09:30 AM
MYSQL connection problem vection Help Archive 1 12/10/2010 05:50 PM


All times are GMT. The time now is 03:01 AM.


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