First, start the MySQL service
1, the way one
A, Win+r: Open the Run window
b, input services.msc Open the Service settings interface
C. Find MySQL service, start or deactivate
2, the way two did not test pass
A, Win+r: Open the Run window
B. Switch directory: cd C:\Program files\mysql\mysql Server 5.5\bin
C, execute command: mysqld--console
Second, start the MySQL client
1, the way one
A, click the MySQL command icon directly, enter the password into
2, Mode two
A, Win+r: Open the Run window
B. Switch directory: cd C:\Program files\mysql\mysql Server 5.5\bin
C, execute command: mysql-uroot-p123456
Iii. Execute SQL script file
1, the way one
A. Go to MySQL command window
B. Select database: Use Test
C, execute script: source E:\TestBoKe\student.sql
2, Mode two
A. Go to MySQL command window
B. Select database: Use Test
C, execute script: \. E:\TestBoKe\student.sql
Iv. export all tables in MySQL database test (the export script does not contain the CREATE DATABASE statement)
1. Win+r: Open the Run window
2. Switch directory: cd C:\Program files\mysql\mysql Server 5.5\bin
3. Execute command: mysqldump test-uroot-p123456 > E:\TestBoKe\testTable.sql
V. Export MySQL database Test (export script contains CREATE DATABASE statement)
1. Win+r: Open the Run window
2. Switch directory: cd C:\Program files\mysql\mysql Server 5.5\bin
3. Executive order: mysqldump test-uroot-p123456--database > E:\TestBoKe\test.sql
Vi. Write batch file Execute script export database
1. Create Bakup.txt
2. Write down script in file
C:
CD C:\Program files\mysql\mysql Server 5.5\bin
Mysqldump test-uroot-p123456--database > E:\TestBoKe\test.sql
3. Change the file suffix to. bat
4. Click File to Run
Vii. Common Scripts
Show databases: see which databases are available
Use test: Enter test database
Show tables: see which table
VIII. database replication
Mysqldump stu-uroot-p--opt | MySQL tea-uroot-p123456-h 192.168.31.239
MySQL Common script