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

How to import SQL files into Mysql database

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-27 11:24:29
forward
2932 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:
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template