Home >Database >Mysql Tutorial >How to import SQL files into Mysql database

How to import SQL files into Mysql database

WBOY
WBOYforward
2023-05-27 11:24:292877browse

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete