A. mysql command line mode settings
Desktop-> My Computer-> properties-> environment variable-> new->
Path= "; path\mysql\bin;" Where path is the installation path for MySQL.
Second, the command line to enter the MySQL method
1.c:\>mysql-h Hostname-u Username-p
Press ENTER to wait and then enter the password. Here hostname is the name of the server, such as the user name Localhost,username for MySQL, such as root.
After entering the command line, you can directly manipulate MySQL.
2. A brief description of the MySQL command:
Mysql->create db dbname;//CREATE database
mysql->create table tablename;//Create tables
mysql->show databases;// Displays the database information and the databases that are available.
mysql->use dbname;//Select the database
mysql->show tables;//display table information, there are those available table
Mysql->describe Displays information about the table that was created
Third, database export database files
1. Export the database mydb to the E:\mysql\mydb.sql file:
Open start-> run-> input cmd enter command line mode
C:\>mysqldump-h localhost-u root-p mydb >e:\mysql\mydb.sql
Then enter the password and wait for the export to succeed and check for success in the target file.
2. Export the mytable in the database mydb to the E:\mysql\mytable.sql file:
C:\>mysqldump-h localhost-u root-p mydb mytable>e:\mysql\mytable.sql
3. Export the structure of the database mydb to the E:\mysql\mydb_stru.sql file:
C:\>mysqldump-h localhost-u root-p mydb--add-drop-table >e:\mysql\mydb_stru.sql
Iv. importing data from external files to the database
To import the SQL statements from the file into the database from E:\mysql\mydb2.sql:
1. Enter MySQL from the command line and use the command to create database mydb2; mydb2.
2. Exit MySQL to enter the command exit; or quit;
3. In cmd, enter the following command:
Copy Code code as follows:
C:\>mysql-h localhost-u root-p MYDB2 < E:\mysql\mydb2.sql
Then enter the password and it's OK.
Resolution of the import file size limit problem
By default: MySQL on the size of the import file limit, the largest 2M, so when the file is very large, directly unable to import, the following resolution of the problem listed below:
1. Modify the relevant parameters in PHP.ini:
There are three parameters that affect the size of the MySQL import file:
Memory_limit=128m,upload_max_filesize=2m,post_max_size=8m
Modify upload_max_filesize=200 M Here to modify the size that meets your needs,
You can modify two other memory_limit=250m post_max_size=200m at the same time
This allows you to import the. sql files under 200M.
The above is about MySQL import export. sql file details, I hope to help you learn.