SA-MP Forums Archive
MySQL - 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 (/showthread.php?tid=505983)



MySQL - Eshaan - 11.04.2014

So, since i was getting a library error on BlueG plugin I switched to StrickenKid plugin!

But I got these errors! Any fix?

Quote:

[Fri Apr 11 04:04:45 2014] -------------------------
[Fri Apr 11 04:04:45 2014] Logging Started
[Fri Apr 11 04:04:45 2014] -------------------------
[Fri Apr 11 04:04:46 2014] Error (0): Failed to connect. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:04:46 2014] Error (0): Failed to connect. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:04:46 2014] Error (0): Failed to connect. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:04:46 2014] Error (0): Failed to connect. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:04:46 2014] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:04:46 2014] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:04:46 2014] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_store_result called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_num_rows called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_free_result called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_real_escape_string called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_store_result called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_num_rows called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:05:41 2014] Error (0): Function: mysql_free_result called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:06:45 2014] Error (0): Function: mysql_real_escape_string called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:06:45 2014] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[Fri Apr 11 04:07:39 2014] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).




Re: MySQL - Conradus - 11.04.2014

It failes to connect to the database, are you sure you filled everything in correctly? (host, username, password, database)


Re: MySQL - citromhun - 11.04.2014

Can not connect to MySQL database, or update the plugins!


Re: MySQL - iSteve - 11.04.2014

the database name or the mysql host name is wrong...


Re: MySQL - Eshaan - 11.04.2014

My Defines

Quote:

//MySQL defines and variables
#define SQL_HOST "localhost"
#define SQL_USER "codt1"
#define SQL_PASS "xxxxx"
#define SQL_DB "codt1"

Quote:

This is under OnGameModeInit()
mysql = mysql_init( );
mysql_connect( SQL_HOST, SQL_USER, SQL_PASS, SQL_DB, mysql, 1 )




Re: MySQL - mamorunl - 11.04.2014

I don't think you can just switch over from one plugin to the other when you have code in your gamemode already.

Anyways, are you sure that your credentials are correct and that your database is running?


Re: MySQL - Eshaan - 11.04.2014

Well, of course I changed the code too! Also, phpmyadmin working with the credentials and I checked them multiple times!


Re: MySQL - Eshaan - 13.04.2014

bump, anyone?

Also, when I use 127.0.0.1 instead of localhost I get "Access denied"
When I use localhost I get this socket error!
Please help me out! phpmyadmin works just fine!


Re: MySQL - AiRaLoKa - 14.04.2014

try to use another mysql server.