PHP export and import MySQL database with command line

Source: Internet
Author: User
Tags import database
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, to move the. sql file to be imported into the bin file, such a path is convenient
2, the 1th step with the above export
3, enter mysql:mysql-u user name-P
4, create a new database you want to build in Mysql-front, which is an empty database, such as creating a new target database named News
as I entered the command line: Mysql>use news;
6, import files: Mysql>source The file name of the import;
as I entered the command line: Mysql>source news.sql;

The above describes the PHP command line to export and import MySQL database, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.