The implementation method for importing SQL data from Mysql command lines is often used. The following describes the steps for importing SQL data from Mysql command lines in detail, I hope it will help you learn Mysql command lines.
My personal practice is: phpmyadmin exports abc. SQL in UTF-8 insert mode
Ftp abc. SQL to server
Ssh to server
Mysql-u abc-p
Use KKK (database name, if not, create database KKK)
Set names 'utf8'
Source abc. SQL
Note: I have seen the set character set utf8; statement. It is not feasible. Chinese characters are garbled.
--------------------------------------------------------------------------------
1. First open mysql in the command line Console
Perhaps the command is as follows:
Mysql-u root-p database_name
Then you may be prompted to enter the corresponding Password
2. The following command may be useful to you. When you want to change a database
Mysql> use database_name
Run the following command:
Mysql> source d: \ datafilename. SQL
Of course, you need to clarify the path of the file and use it correctly.
Enter bin in the directory where mysql is installed. Enter the command to import SQL.
For example, your mysql is installed in d: \ mysql
The procedure is as follows:
Start> RUN> Enter CMD
D:
Cd mysql \ bin
Mysql-u root-p123456 test <d: \ a. SQL
Here, root is your mysql administrator username, and 123456 is the password test is the database name d: \ a. SQL is the location of the backup data file.
For Windows, go to the Bin folder in the MYSQL file directory from the command prompt and execute the command
Mysql-u root-p databasename <db. SQL
Here, root is your MYSQL user name, databasename is your database name, and db. SQL: You are a file. note that you must set db. the SQL statement can be placed in the bin folder. of course, the file location can be changed.
For LINUX, enter
Mysql databasename <db. SQL
The default mysql command is the system command.
<! -- NewPP limit report Preprocessor node count: 4/1000000 Post-expand include size: 0/2097152 bytes Template argument size: 0/2097152 bytes Expensive parser function count: 0/100 --> <! -- Saved in parser cache with key wikiguo_wiki-wiki _: pcache: idhash: 2032-0! 1! 0 !! Zh-cn! 2! Edit = 0 and timestamp 20090724051413 -->
How to insert an array into a mysql table in php
MySQL Data Table Traversal method
Mysql Character Set modification for used data tables
Several ways to copy a table in mysql
In-depth study on MySQL's data deletion from multiple tables