How MySQL imports a database

Source: Internet
Author: User
Tags mysql command line mysql import web database

How MySQL imports a database
    • |
    • Views: 41023
    • |
    • Updated: 2012-11-01 19:45
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
Step through Reading

MySQL is a small and medium-sized relational database management system developed by the Swedish MySQL AB company, currently owned by Oracle Corporation. MySQL is an associated database management system that keeps data in separate tables rather than putting all of the data in a large warehouse, which increases speed and increases flexibility. MySQL's SQL language is the most commonly used standardized language for accessing databases. MySQL software uses the GPL (GNU General Public License), it is divided into the free version and commercial version, because of its small size, speed, low total cost of ownership, especially the open source, the development of the general small and medium-sized web site to choose MySQL as a Web database. Thanks to its free version of performance, PHP and Apache make a good development environment.

So how does MySQL import the database ? In fact, the introduction of the method is very simple, here we use the tool to import and only use the MySQL command interface to import two ways, of course, MySQL database GUI tool is a lot of, use it is more convenient, follow me to operate it!

Tools/Materials
    • Navicat for MySQL

    • MySQL command line interface

    • SQL script?

Method One:
    1. First we use the command line interface provided by MySQL to import the database, to ensure that the MySQL database is installed on our own computer, we can confirm whether the MySQL database is installed by the command line, of course, the first step is to open the MySQL database service, we use the command line to open:

    2. After starting MySQL, we find the script file we need to use, that is, the database file, of course, we have to create a database, so that the script can be imported, as shown in:

    3. We're copying the script to the root of the local disk so it's easy to get into the script, which is illustrated in D, using Test.sql: Then we go to the command line, use source d:/test.sql; To import the database, first into MySQL, as shown in:

    4. First to set up a database in the database, and then import the script, so first set up a database Oh, do not script is not know which database you are going to import the script, as shown in:

    5. You can then enter the import. sql File command:

      mysql> use database name;

      Mysql> SOURCE D:/test.sql;

      As shown in the following:

    6. 6

      See the above screen, indicating that the MySQL database has been imported successfully Oh!

      Is it very simple? Now to introduce the second method, using the MySQL graphics tool to import the database, we still use the Test.sql script to explain:?

      END
Method Two:

Double-click the remote connection you just established to enter the screen as shown:

10, click on the data export, enter the screen shown:

In the box to the left of the first row, select the database you want to export, and choose an export form under options. The first is to export each data table as a single file, and the second is to export all data tables as a single file.

11. After the selection is complete, click Start Export to start exporting as shown in:

Wait until the stop in the gray, the description of the export is finished, you can go to the corresponding folder to view the exported SQL file, of course you can also click Stop to stop the export.

The above is how to use the MySQL Workbench to export the remote database process, export the local database is the same operation, I hope the work of the webmaster is helpful to everyone ~

How MySQL imports a database

Related Article

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.