"Run theirfilename.sql to generate the necessary tables in the database"
The *.sql file is a text file with SQL statements to be executed by the mysql server.
You can run it through a tool like phpMyAdmin - just open a query window there and copy and paste the content of that text file in there. phpMyAdmin and possibly other frontends will also allow to upload a *.sql file through the web browser. In phpMyAdmin click on the SQL tab.
If you don't have any such front end installed, you can also go to the shell (assuming you're on a Linux box here). If your site is hosted somewhere, you'll need putty (or a similar tool) to connect to the server.
Ftp your *.sql file to the (remote) machine if not done yet.
Execute this command and you'll be fine:
You can use following commands at your mysql> prompt:
mysql> source file_name.sql
mysql> \. file_name.sql
of course you must either select database in the .sql file or you must 'use' the database first before running a script.
$ ssh firstname.lastname@example.org
$ mysql -u username -p -h localhost data-base-name < data.sql
$ mysql -u username -p -h 22.214.171.124 databasename < data.sqlOR use hostname such as mysql.hosting.com
$ mysql -u username -p -h mysql.hosting.com database-name < data.sql
$ mysql -u username -p -h 126.96.36.199 < data.sql
- Log into phpMyAdmin.
- Select your preference database on the left database navigation drop down list.
- Click on Import tab on the top.
- Select your sql dumb file at File to import
- Then select your mysql database charset (ex: Latin1, utf-8)
- and click GO and it’s done!
To restore mysql database from a dump file, just type the command below:
mysql -u myusername -p mydatabasename < mydump_file.sqlOf course you need to replace #myusername# to your database username and #mydatabase# to your target database. and rename #mydump_file.sql# to your dump file file name (Ex: dump.sql) Once you enter the command, the linux/unix shell will prompt you for your database user password, just key in your database password and you are done