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.
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.