DelphiFAQ Home Search:

InterBase, MS-SQL, mysql, Oracle
C#, C++, Delphi, Java,
JavaScript, perl, php, Visual Basic, VBScript
Apache, Network, Shell
Web Publishing
JavaScript, perl CGI, VBScript, Web Hosting
Apache, File Types, Internet Explorer,
Network, Printing, Processes
Outside the Cube
Auto, Computer Hardware,
Finances, Dating Scams,
Household, Male Dating Scammers,
Other Scams, Travel

Featured Article

How to run a *.sql script (mysql)


I am installing a .php based tool, and one of the final instructions is to "Run the mysql.sql script to create the necessary tables in the database.". How to I achieve this?


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:

mysql <my_db_name> -u<user_name> -p<password> <mysql.sql

Generated 8:02:30 on Sep 24, 2018