Here is using mysql command-line to import large sql data.Maybe you will need it when you want to import a large sql file .

For people who regularly use MYSQL, phpmyadmin is an essential tool. This is a very powerful tool, almost all database operations can be done, but it also has a weakness for import large data files to the remote server will be excruciatingly slow, and even the long-term response.

Why would this situation? When we choose a sql data file and submit, the server first to upload files to the server before performing the import code to import data into the database. We know phpmyadmin uploaded data files via the web, web upload is very unstable, especially when network is not very good, which is why we have so many times in front of the computer waiting eagerly for the final but did not result reasons.

Through the above analysis, we know that this issue is a web upload rather than import program, so if you can avoid the web upload this problem can be easily handled. We may think that the powerful ftp upload tool, but phpmyadmin can not select the file on the remote-way servers, it is very depressing.

Here we have to give up phpmysqladmin,.We need use mysql statement to import the database. Many people will wonder how to execute SQL statements, this is a main issue, which requires your space supports SSH (Secure Shell Protocol), and you need know some linux command.

First, log on to the server via SSH ,through some simple linux command to find the sql files, and then run the following code:

mysql sql_db_name < sql_data.sql

If executing the command without any prompting, our data file has been imported successfully.But sometimes you may encounter an error message that your permission is not enough, then we need to add some parameters.

mysql -hlocalhost -uusername -p sql_db_name < sql_data.sql

After press Enter, there will be prompted for a password, and then enter your database password can be imported.

Parameter -h is specified import server,-u is the user name of the database,-p is the login password of the database, without adding a space behind the three parameters.

This address is