Detailed explanation of MySQL database source command_MsSql

微波
Release: 2017-06-28 15:40:56
Original
14292 people have browsed it

This article mainly introduces the detailed explanation ofMySQLdatabase source command and related information about examples. Friends in need can refer to

MySQL database source Command details and examples

MySQL database source command, this command is a database import command. The usage of the source command is very simple. First, you need to enter the command line management interface of the MySQL database, then select the database to be imported, and execute the source command. As shown below.

MySql database source command


mysql> use test Database changed mysql> set names utf8; Query OK, 0 rows affected (0.00 sec) mysql> source C:/test.sql Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.33 sec) Query OK, 0 rows affected (0.07 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.03 sec) Query OK, 1 row affected (0.02 sec) mysql> set names gbk; Query OK, 0 rows affected (0.00 sec)
Copy after login


Tips:

1. In Windows, the file path should be replaced with "/" for the default path character "\", such as:


mysql> source C:/test.sql
Copy after login


2. Make sure the character encoding of the script file (.sql / .ddl) is utf8;

3. Before running the source command, execute the command: set names utf8;


mysql> set names utf8; mysql> source C:/test.sql
Copy after login


4. Before running the source command If you need to view Chinese correctly on the command line, first execute the command: set names gbk; modify the command line window character encoding. As follows:


mysql> set names gbk; mysql> select * from user;
Copy after login

The above is the detailed content of Detailed explanation of MySQL database source command_MsSql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!