简体   繁体   中英

import the data to db in mysql

I have sql data in .sql format. and I need to import it to the MySql database. What are all the steps should I take. Thanks in advance.

Your .sql file only contains a lot of SQL queries.

The simplest way to import your file is to execute those SQL queries, with the mysql command-line tool :

mysql --user=USER --password=PASSWORD --host=HOST DB_NAME < your_sql_file.sql

This will send all the content of your_sql_file.sql to the mysql program, which will execute it -- and, so, import your data.


Of course, you'll have to replace the upper-case USER , PASSWORD , HOST , and DB_NAME with your real connection informations.

Are you using any software to connect with mysql? If yes, then there should be opion for importing data. Try that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM