SA-MP Forums Archive
[MySql] Errors in server log HELP - 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] Errors in server log HELP (/showthread.php?tid=446814)



[MySql] Errors in server log HELP - Nick_Phelps - 27.06.2013

Okay, so recently I got a .sql file from a friend and he had it running on his own volt host database, worked fine, I plugged it into the mysql.cfg with his details and it worked all fine... I made a export of the same database on his volt and put it on my XAMPP mysql... I made a new database imported the .sql and the tables look exactly like his, however when I run the samp-server.exe I get something like this...

Код HTML:
[09:36:49] SELECT * FROM `houses`
[09:36:49] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:36:49] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:36:49] Dumping query from 2013/6/27 (9:36:49)

Description: No database selected (index 0). Query:
Here is my mysql.cfg (Note, I do not have a XAMPP password set)

Код HTML:
HOST=localhost
DB=script
USER=root
PASS=
Whoever can help me fix this will get + rep



Re: [MySql] Errors in server log HELP - Akira297 - 27.06.2013

1. Either there is no table or row of `Houses` and show the query dump.


Re: [MySql] Errors in server log HELP - ReVo_ - 27.06.2013

The error #1046 means

Код:
#1046 - No database selected
mysql_connect params are something like this:

mysql_connect(host, user, DATABASE, pass)

Make sure you inserted a valid database.

You can try to run this query:

"USE database_name"

to select the database to use (check the mysql_connect line before try this, this should be automatic!)



Oh:

script database is valid? Is created?


Re: [MySql] Errors in server log HELP - Nick_Phelps - 27.06.2013

Yes, I mean.. It all worked completly fine in my friends volt mysql... It is done exactly as it was in his sql.. But it wont work.


Re: [MySql] Errors in server log HELP - Akira297 - 27.06.2013

Quote:
Originally Posted by Nick_Phelps
Посмотреть сообщение
Yes, I mean.. It all worked completly fine in my friends volt mysql... It is done exactly as it was in his sql.. But it wont work.
You need to show us your error log for the direct error.


Re: [MySql] Errors in server log HELP - Nick_Phelps - 27.06.2013

Where is the error log?


Re: [MySql] Errors in server log HELP - Akira297 - 27.06.2013

Quote:
Originally Posted by Nick_Phelps
Посмотреть сообщение
Where is the error log?
It gave you the error inside the console look there.


Re: [MySql] Errors in server log HELP - Nick_Phelps - 27.06.2013

Код HTML:
[09:36:49]  ======================================= 
[09:36:49]  |                                     | 
[09:36:49]  |   Error: Could not connect to YSI   | 
[09:36:49]  |  update server (response was 001).  | 
[09:36:49]  |                                     | 
[09:36:49]  ======================================= 
[09:36:49]  
[09:36:49] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:36:49] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:36:49] Dumping query from 2013/6/27 (9:36:49)

Description: No database selected (index 0). Query:


[09:36:49] SELECT `gMOTD`,`aMOTD`,`vMOTD`,`cMOTD`,`pMOTD`,`ShopTechPay` FROM `motd`
[09:36:49] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:36:49] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:36:49] Dumping query from 2013/6/27 (9:36:49)

Description: No database selected (index 0). Query:


[09:36:49] UPDATE `accounts` SET `Online` = 0 WHERE `Online` = 0
[09:36:49] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:36:49] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:36:49] Dumping query from 2013/6/27 (9:36:49)

Description: No database selected (index 0). Query:


[09:36:49] SELECT * FROM `houses`
[09:36:49] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:36:49] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:36:49] Dumping query from 2013/6/27 (9:36:49)

Description: No database selected (index 0). Query:


[09:36:49] SELECT * FROM `businesses`
[09:36:49] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:36:49] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:36:49] Dumping query from 2013/6/27 (9:36:49)

Description: No database selected (index 0). Query:

[09:37:36] SELECT `Username` FROM `accounts` WHERE `Username` = 'Charles_Greens'
[09:37:52] [part] Charles_Greens has left the server (0:1)
[09:37:56] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:37:56] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:37:56] Dumping query from 2013/6/27 (9:37:56)

Description: No database selected (index 0). Query:


[09:37:56] UPDATE `letters` SET `Delivery_Min` = `Delivery_Min` - 1 WHERE `Delivery_Min` > 0
[09:37:56] [MySQL] Query Error - (ErrorID: 1046) (Handle: 1)
[09:37:56] [MySQL] Check /logs/querydump.log to review the query that threw the error.
[09:37:56] Dumping query from 2013/6/27 (9:37:56)

Description: No database selected (index 0). Query:



Re: [MySql] Errors in server log HELP - Akira297 - 27.06.2013

Database doesn't exist, you've mistyped the database, or your MySQL connection isn't selecting the database properly.

Check if the database exists, check if its properly spelled in your config, and check your connection and see if it selects the database you want


Re: [MySql] Errors in server log HELP - Nick_Phelps - 27.06.2013

Could it be because im using "localhost" as my host?