Abstract:
MYSQL > Desktop > Computer > Properties > Environment Variables > New >PATH= “; The path \ mysql \ bin.” Path indicates the installation path of MYSQL. C:\> MYSQL -h hostname -u username -p Press ENTER, wait, and ENTER the password.
MYSQL > select * from ‘MYSQL’;
Desktop -> My Computer -> Properties -> Environment Variables -> New ->
PATH = “; The path \ mysql \ bin.” Path indicates the installation path of MYSQL.
MYSQL > select * from ‘MYSQL’;
1.C:\>mysql -h hostname -u username -p
Press ENTER, wait and ENTER your password. Hostname indicates the server name, for example, localhost, and username indicates the MYSQL username, for example, root.
After entering the command line, you can directly operate MYSQL.
MYSQL > select * from ‘MYSQL’;
mysql->CREATE DATABASE dbname; // Create database
mysql->CREATE TABLE tablename; / / create a table
mysql->SHOW DATABASES; // Display database information, which databases are available.
mysql->USE dbname; // Select the database
mysql->SHOW TABLES; // Display table information, which tables are available
mysql->DESCRIBE tablename; // Displays information about the created table
Export database file from database:
Select * from e: mysql.mydb.sql; select * from e: mysql.mydb.sql;
Open Start -> Run -> enter CMD to enter the command line mode
c:\>mysqldump -h localhost -u root -p mydb >e:\mysql\mydb.sql
Then enter the password, wait for a while to export the success, you can check whether the target file is successful.
Select * from e:\ mysql.mytable.sql; select * from e:\ mysql.mytable.sql;
c:\>mysqldump -h localhost -u root -p mydb mytable>e:\mysql\mytable.sql
Select * from e:\mysql\mydb_stru.sql; select * from e:\mysql\mydb_stru.sql
c:\>mysqldump -h localhost -u root -p mydb –add-drop-table >e:\mysql\mydb_stru.sql
Import data from an external file into a database:
Import SQL statement from e:\mysql\mydb2.sql into database:
1. Run the CREATE DATABASE mydb2 command to open mysql. Create database myDB2.
2. Run the exit command to exit mysql. Or quit.
3. Enter the following command in CMD:
c:\>mysql -h localhost -u root -p mydb2 < e:\mysql\mydb2.sql
Then enter your password and you’re done.
Five. Let’s talk about how to solve the problem of import file size limitation:
By default, mysql has a limit on the size of files to be imported. The maximum size is 2M. Therefore, when a file is too large, it cannot be imported.
1. Modify related parameters in php.ini.
There are three parameters that affect the size of mysql import files:
memory_limit=128M,upload_max_filesize=2M,post_max_size=8M
Upload_max_filesize =200 M
Memory_limit =250M post_max_size=200M can be modified simultaneously
Desktop -> My Computer -> Properties -> Environment Variables -> New ->
PATH = “; The path \ mysql \ bin.” Path indicates the installation path of MYSQL.
MYSQL > select * from ‘MYSQL’;
1.C:\>mysql -h hostname -u username -p
Press ENTER, wait and ENTER your password. Hostname indicates the server name, for example, localhost, and username indicates the MYSQL username, for example, root.
After entering the command line, you can directly operate MYSQL.
MYSQL > select * from ‘MYSQL’;
mysql->CREATE DATABASE dbname; // Create database
mysql->CREATE TABLE tablename; / / create a table
mysql->SHOW DATABASES; // Display database information, which databases are available.
mysql->USE dbname; // Select the database
mysql->SHOW TABLES; // Display table information, which tables are available
mysql->DESCRIBE tablename; // Displays information about the created table
Export database file from database:
Select * from e: mysql.mydb.sql; select * from e: mysql.mydb.sql;
Open Start -> Run -> enter CMD to enter the command line mode
c:\>mysqldump -h localhost -u root -p mydb >e:\mysql\mydb.sql
Then enter the password, wait for a while to export the success, you can check whether the target file is successful.
Select * from e:\ mysql.mytable.sql; select * from e:\ mysql.mytable.sql;
c:\>mysqldump -h localhost -u root -p mydb mytable>e:\mysql\mytable.sql
Select * from e:\mysql\mydb_stru.sql; select * from e:\mysql\mydb_stru.sql
c:\>mysqldump -h localhost -u root -p mydb –add-drop-table >e:\mysql\mydb_stru.sql
Import data from an external file into a database:
Import SQL statement from e:\mysql\mydb2.sql into database:
1. Run the CREATE DATABASE mydb2 command to open mysql. Create database myDB2.
2. Run the exit command to exit mysql. Or quit.
3. Enter the following command in CMD:
c:\>mysql -h localhost -u root -p mydb2 < e:\mysql\mydb2.sql
Then enter your password and you’re done.
Five. Let’s talk about how to solve the problem of import file size limitation:
By default, mysql has a limit on the size of files to be imported. The maximum size is 2M. Therefore, when a file is too large, it cannot be imported.
1. Modify related parameters in php.ini.
There are three parameters that affect the size of mysql import files:
memory_limit=128M,upload_max_filesize=2M,post_max_size=8M
Upload_max_filesize =200 M
Memory_limit =250M post_max_size=200M can be modified simultaneously
This allows you to import. SQL files up to 200M.
This article is transferred from the blog park knowledge world blog, the original link: MYSQL import and export. SQL file, if you need to reprint, please contact the original blogger.
Copyright Notice: The content of this article is contributed by Internet users, copyright belongs to the author, the community does not have the ownership, also do not assume the relevant legal responsibility. If you find any content suspected of plagiarism in our community, you are welcome to send an email to [email protected] to report and provide relevant evidence. Once verified, our community will immediately delete the content suspected of infringement.
The original link