1. Use the source
command in Mysql under the Win system to import the SQL file:
mysql -u root -p
mysql>use 数据库名
mysql>source d:/数据库名
This completes the import of the SQL file under the Win system.
2. How to import SQL files under Linux system:
(1) Create a new empty database in Mysql
mysql>create database 123;
(2) Set the encoding for the database
mysql>set names utf8;
(3) Import data SQL file
mysql>source /home/abc/123.sql;
The above is the detailed content of How to import SQL files into Mysql database. For more information, please follow other related articles on the PHP Chinese website!