The quickest way to import a properly generated SQL dump containing structure and table definitions plus data into a MySQL database is to simply pipe the file directly to the powerful mysql command function via a terminal window.
The command would look something like this:
mysql --verbose -u username -ppassword < sqldump.sql
Although the –verbose switch is technically not needed, it does make it easier to follow the progress of the resulting import. The -u and -p switches indicates the account with which to access the MySQL server. (Note the lack of space between -p and the password).
Nifty.
You might also enjoy:
-
Backing up your MySQL database or generating a copy of it to shift around is quite a simple affair thanks to the powerful mysqldump command that ships with ...
-
One of the easiest ways to backup and restore your MySQL database (or even just to move databases between different servers) is to make use of MySQL's handy ...
-
One of the most important things you need to do when setting up your new MySQL server instance is to set the password for the root user account. By default, ...
-
MySQL gets installed with a default root account under the username "root". Sometimes the system will allow you to install a root account without a password ...
-
To stop a MySQL server instance on an Ubuntu linux install via the command line is as simple as entering: sudo /etc/init.d/mysql stop Alternatively, to st ...