PHP uses command line to export and import MySQL database, command line MySQL
Command line Export database:
1. Go to the Bin folder in the MySQL directory: cd MySQL to the Bin folder directory
As I entered the command line: CD C:\Program files\mysql\mysql Server 4.1\bin
2, Export database: Mysqldump-u user name-p database name > exported file name
As I entered the command line: Mysqldump-u root-p News > News.sql (input will let you enter the password into MySQL)
(If you export a single table, enter the table name after the database name)
3, you will see the file News.sql automatically generated into the bin file
Command line Import Database:
1, move the. sql file to be imported into the bin file, such a path is more convenient
2, the 1th step with the above export
3, enter mysql:mysql-u user name-P
As I entered the command line: mysql-u root-p (Input the same will let you enter the Ysql password)
4, create the database you want to build in Mysql-front, this is an empty database, such as a new target database named News
5, Input: Mysql>use target database name
As I entered the command line: Mysql>use news;
6, import file: mysql>source import filename;
As I entered the command line: Mysql>source news.sql;
http://www.bkjia.com/PHPjc/1048741.html www.bkjia.com true http://www.bkjia.com/PHPjc/1048741.html techarticle PHP export and import MySQL database with command line, command line MySQL command line export database: 1, go to the Bin folder in MySQL directory: cd mysql to bin folder directory as I entered ...