• notice
  • Congratulations on the launch of the Sought Tech site

Search with SQL statements to solve the problem with MySQL imported big data files

For people who often use MYSQL, phpmyadmin is a must-have tool.This tool is very powerful and can almost complete all database operations, but it also has a weakness.It will be extremely slow when importing large data files to a remote server, and it may even appear to be unresponsive for a long time.

Why does this happen? When we select a sql data file and submit it, the server first uploads the file to the server, and then executes the import code to import the data into the database.We know that phpmyadmin is a data file uploaded through the web, and the web upload is very unstable, especially when the Internet speed is slow.This is why we have so many times to wait in front of the computer and finally no results s reason.

Through the above analysis, we know that this problem is caused by web uploading rather than importing programs, so it would be easier to avoid the problem of uploading via web.We may think of the powerful ftp upload tool, but phpmyadmin cannot select files on the remote server, which is very depressing.

Here we are going to give up phpmysqladmin, through mysql statement to import the database.Many people will wonder how to execute SQL statements.This is a key issue.This requires your space to support SSH (Secure Shell Protocol), and you have to know some linux commands.

First log in to the server via SSH (I use the putty login tool), find our sql file through some simple linux commands, and then run the following code:

mysql db_name < data_file.sql

If there is no prompt after executing the command, it means that our data has been imported successfully (note that the file format is date_file.sql, sql.gz will be wrong in Chinese).



Technical otaku

Sought technology together

Related Topic


Leave a Reply