SA-MP Forums Archive
Question about .sql file - 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: Question about .sql file (/showthread.php?tid=523983)



Question about .sql file - kamiliuxliuxliux - 04.07.2014

Can anyone explain me what is .sql file for? 'Cuz in-game server works with MySQL database from phpmyadmin. But in every GM I download where's the .sql file.


Re: Question about .sql file - DarkZeroX - 04.07.2014

GameMode not sure its not SQL that is why it is there maybe not.

SQL is the remote database.


Re: Question about .sql file - Vince - 04.07.2014

Import them. Fastest through command line honestly.

Windows:
1) Copy the .sql file to the directory where MySQL is installed (easiest)(e.g. E:\xampp\mysql\bin).
2) While in the directory, hold the shift key, then right click while still holding the shift key. From the menu choose "Open command promt here" (or equivalent).
3) Issue the command:
Код:
mysql -u root -p
4) When prompted for password, enter your MySQL root password and press enter. The promt should change to "mysql>".
5) Create a database (note: semicolon important)
Код:
CREATE DATABASE yourdbname;
6) Exit mysql prompt:
Код:
exit
7) Now import the SQL file:
Код:
mysql -u root -p yourdbname < thefilename.sql
8) Enter your MySQL root password once more.
9) Import can take a few seconds. And then you're done.

Same procedure for Linux, but you can skip step 1 and 2.