Mysql Data Import

Source: Internet
Author: User
Tags heidisql

Today I tried to import a 150M data file (. sql) with Heidisql, resulting in an out of memory error. Search on the Internet a lot of cases, have failed to solve the problem. I even suspect that MySQL's default memory settings are too small. Then ran to the My.ini file to modify the size of the innodb_buffer_pool_size to 96M * 6. To heidisql inside again to import, error message will not come out immediately, but after about a minute or appear out of memory error.

Later a friend said, bulk import data do not use the MySQL client, will explode. So, with the Cmd bar, online search for the next solution:

How to import a SQL file using the command line in MySQL?

A common use of mysqldump are for making a backup of a entire database:shell> mysqldump db_name > Backup-file.sqlyou Can load the dump file back into the server like this:unixshell> MySQL db_name < backup-file.sqlsame in Windows com and promptmysql-p-u[user] [database] < backup-file.sqlpowershellc:\> cmd.exe/c "Mysql-u root-p db_name < BAC Kup-file.sql "MySQL command linemysql> use db_name;mysql> source backup-file.sql;

I used the last method, CD to the folder to hold the SQL file, and then mysql-uroot-proot into MySQL,

then use DatabaseName;

SOURCE **.sql;

The data in the SQL file is automatically imported into the specified DatabaseName database.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.