Phpmyadmin import/export database backup tutorial

Source: Internet
Author: User
Tags mysql commands php website how to use phpmyadmin
During PHP website construction, Mysql database maintenance is a daily task. the backup function of Mysql database import and export is one of them. in the previous PHP Tutorial, during PHP website construction, mysql database maintenance is a daily task. the backup function is one of the following, in the previous PHP Tutorial, I introduced a lot of articles about how to maintain the Mysql database using Mysql commands. today I will talk about how to use phpmyadmin to import and export Mysql databases for database backup, phpmyadmin is a third-party visualization tool for maintaining Mysql databases. it is easy to operate.

Before using phpmyadmin to import and export data, you must first log on to the phpmyadmin management interface. check whether your Mysql service is enabled. Otherwise, you cannot log on to phpmyadmin.

1
NET START MYSQL

Start the Mysql service.

  Phpmyadmin export tutorial

To maintain the Mysql database and ensure data security, the first step is to regularly export (back up) Mysql database data on time. so let's first talk about how to use phpmyadmin to export Mysql database, similar to using mysqldump to export a Mysql database, you can use phpmyadmin to set the database to be exported or specify to export a single data table.

  Step 1 of phpmyadmin export: Click on the rightExportMenu link. The phpmyadmin export page is divided into the left and right sections, and the left is divided into the database to be exported (you can select either export all or export a database), and then select the file type exported by phpmyadmin, the default export format is SQL. other commonly used export formats include CSV, WORD, XLS, and YAML.

  Phpmyadmin exports part 2: Set options on the phpmyadmin export page,

Phpmyadmin export options



Phpmyadmin export database options



Phpmyadmin data export options


  Phpmyadmin export option description:

1. if you need to use phpmyadmin to export multiple SQL files, you can use the comment option to describe.

2. if you may need to migrate data from different databases, you can select the corresponding database in SQL compatibility mode, such as ORACLE.

3. you can set the data export type in the data export option of phpmyadmin. the default value is INSERT. Other options include UPDATE and REPLACE. The difference is that when phpmyadmin is imported in the future, if there is a conflict with the original row during INSERT, it will exit, and REPLACE will overwrite the original row, so you can set the DROP option as needed.

  Phpmyadmin exports part 3: Command to save the SQL file. here I name it my blog website leapsoul.cn.

  Special instructions on phpmyadmin export: The phpmyadmin export portal has different export functions. if you log on to the phpmyadmin console to go to the export page, you can export the Mysql database, if you click the specific database on the left side of phpmyadmin to go to the phpmyadmin export interface, you can export a database, not only can you export all the content of the specified database, you can also specify a specific data table for export.

  Phpmyadmin import tutorial

When an exception occurs in the website database, if we have backed up the database before, we only need to use the Mysql command or phpmyadmin to import the previously exported SQL file to the corresponding database.

Phpmyadmin Import Settings page


  Step 1 of phpmyadmin import: Click on the rightImportMenu link. in the file to be imported, click Select File (select the SQL file exported by phpmyadmin ). We noticed that there is a prompt (maximum size of 2 MB) on the right side, which tells you that phpmyadmin imports a maximum file size of 2 MB by default. if you want phpmyadmin to import large files, the simplest way is to modify php. configure the file upload size in the ini configuration file.

  Step 2 of phpmyadmin import: The character set of the imported file. the default value is utf8. Note that the character set of the SQL file imported and exported by phpmyadmin must be consistent. Otherwise, the Mysql database may encounter garbled characters.

  Partial import instructions: When the upload of large files is interrupted, you can continue the import from the interrupted line.

The format of the imported file is similar to that of The phpmyadmin export page. you only need to select the correct phpmyadmin import file format.

Finally, click "execute" to complete the phpmyadmin import operation.

At this point, the tutorial on using phpmyadmin to import and export Mysql databases for database maintenance is complete. it is as convenient as using mysqldump to import and export phpmyadmin.

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.