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

How to import SQL files into Mysql database

WBOY
Release: 2023-05-27 11:24:29
forward
2875 people have browsed it

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:/数据库名
Copy after login

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;
Copy after login

(2) Set the encoding for the database

mysql>set names utf8;
Copy after login

(3) Import data SQL file

mysql>source /home/abc/123.sql;
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template