MySQL Import and Export Database Files

Source: Internet
Author: User
Tags mysql commands mysql gui mysql gui tools mysql import
MySQLGUIToolsv5.0 must be installed to use a graphical auxiliary tool. It is a visual MySQL database management console and provides four very useful images.

To use a graphical auxiliary tool, you first need to install MySQL GUI Tools v5.0, which is a visual interface of the MySQL database management console, providing four very useful graphics

MySQL Import and Export Database Files

Method 1: To use a graphical auxiliary tool, you first need to install MySQL GUI Tools v5.0. It is a visual interface of the MySQL database management console and provides four very useful graphical applications, it facilitates database management and data query. These graphical management tools can greatly improve the efficiency of database management, backup, migration and query, even if there is no rich SQL language basis for users to freely apply.

They are: MySQL Migration Toolkit: database Migration MySQL Administrator: MySQL manager MySQL Query Browser: Graphical client for Data Query MySQL Workbench: DB Design Tool

Method 2: Use the command line method provided by MySQL to import and export MySQL. SQL file:

The procedure is as follows: January 1, 1111. set the command line mode for setting the command line mode of MySQL Command Line Mode :::: desktop-> my computer-> properties-> environment variables-> New-> PATH = "; path \ MySQL \ bin;" where path is the installation PATH of MySQL. 2222. the following is a brief introduction of how to enter the MySQL command line ::::

1. C: \> MySQL-h hostname-u username-p press ENTER, and then ENTER the password. Here, hostname is the name of the server, such as localhost and username is the username of MySQL, such as root. After entering the command line, you can directly operate MySQL.

2. brief Introduction to MySQL commands: MySQL-> create database dbname; // create database MySQL-> create table tablename; // create table MySQL-> show databases; // display DATABASE information, there are available databases. MySQL-> USE dbname; // select the database MySQL-> show tables; // displays the table information, including the available TABLES MySQL-> DESCRIBE tablename; // displays the information of the created table

3. Export Database files from the Database Export Database Files export database files from the database ::

1. Export the database mydb to the e: \ MySQL \ mydb. SQL file: Open start-> Run-> Enter cmd to enter the command line mode

1. c: \> MySQLdump-h localhost-u root-p mydb> e: \ MySQL \ mydb. then, enter the password and wait for a moment until the export is successful. You can check whether the export is successful in the target file.

2. export mytable from mydb to e: \ MySQL \ mytable. in the SQL file: c :\> MySQLdump-h localhost-u root-p mydb mytable> e: \ MySQL \ mytable. SQL 3. export the database mydb structure to the e: \ MySQL \ mydb_stru. SQL file:

4. import data from external files to the database:

Import the SQL statements in the file into the database from e: \ MySQL \ mydb2. SQL:

1. Enter MySQL from the command line, and then run the create database mydb2 command to CREATE the DATABASE mydb2.

2. To exit MySQL, enter the command exit or quit;

3. Enter the following command in CMD: c: \> MySQL-h localhost-u root-p mydb2 <e: \ MySQL \ mydb2. SQL and then enter the password.

5. next, let's talk about the size of imported files. Next, let's talk about the restrictions on the size of imported files. restrictions:

By default, the size of the MySQL imported file is limited to 2 MB. Therefore, when the file is large, it cannot be imported directly. The solution to this problem is as follows:

1. in php. modify related parameters in ini: There are three parameters that affect the MySQL import file size: memory_limit = 128 M, upload_max_filesize = 2 M, post_max_size = 8 M modify upload _...... the above content is to import and export MySQL. SQL file introduction, hope you have some gains

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.