. If the file does not exist or is inaccessible due to permissions, an error is generated. Absolute paths must be used before MySQL5.5.8. Relative paths can be used after 5.5.8.· --defaults-group-suffix=str:read not only uses the usual group names, but also supports defining groups. For example: Mysqldump typically reads [client] and [mysqldump] groups. The [Clie
-transaction db_name > Db_name.sql
1.2 RestoreA file backed up with Mysqldump is a SQL script that can be poured directly, and there are two ways to import the data.
Directly with MySQL clientFor example:
/usr/local/mysql/bin/mysql-uyejr-pyejr Db_name
Using the SOURCE syntaxIn fact, this is not a standard SQL syntax, but the functionality provided by the MySQL client, for
run the load data infile statement to restore the DATA table. Example:
Load data infile \ '/tmp/db_name/tbl_name.txt \ 'into TABLE tbl_name;
The permission requirements are similar to those described above. Before you import data, the data table already exists. If you are worried that data will repeat, you can add the REPLACE keyword to REPLACE existing records or use the IGNORE keyword to IGNORE them.
Supplement:
Shell>
Mysqldump is a client program used by mysql to store databases. It mainly produces a series of SQL statements that can be encapsulated into a file. This package contains all
Mysqldump is a client program used by mysql to store databases. It mainly produces a series of SQL statements that can be encapsulated into a file. This package contains all
Mysqldump is
Tags: blog class code tar ext intWe will certainly encounter the backup database in the course of running the project, restore the database situation, we generally use two ways to deal with:1. Import and export backup data using into outfile and load data infileThe advantage of this method is that the exported data can be self-defined format, and the export is pure data, there is no table information, you can directly import another database with the different tables, compared to
1. mysqldump-A database backup program
Mysqldump [Options] [db_name [tbl_name...]
If you do not specify any tables, the entire database will be exported.
2. Option [2]
-- Opt optimizes the table's dump speed and writes the dump file, which is the best reload speed. This option enables-add-drop-table, -- add-locks, -- all -- extended-insert, -- quick, and -- lock-tables.
3.
If you export a table after the database and then write the table name, for example: ... xxxdb xxxtable > C:\mysql ...
Copy the shell script on top of the. bat batch script into the appropriate location. Restore as follows: MySQL>source C:\xxx.sql 2. Windows Scheduled Tasks Open: Create tasks, Task Scheduler, management tools, control Panel Conventional Triggers (backups are performed 3 hours a day) Save directly, then set the
to adding the following information:--skip-add-drop-table,--skip-add-locks,--skip-comments,--skip-disable-key S,--skip-set-charset options.--dump-date (default): Add a comment after each backup (the comment is the backup date), cancel the default by:--skip-dump-date--flush-logs,-F: Save Log before backup--ignore-table=db_name.tbl_name: Ignore table (or view), do not back up multiple tables, reuse the statement multiple times--order-by-primary: Back up each row in the order of the primary key or
indicates the database to be backed up on the host. If you want to back up all the databases on a MySQL host, you can use the--all-databases option, as follows: --all-databases
> Test. Dump E. Recovering a database from a backup file [database name[backup file name] 2, with Linux cron command to achieve scheduled backup For example, to back up all the databases on a host and compress the dump file to GZ format every 1:30, add the following li
mysql| detailed
MySQL has a lot of ways to import data, but these are only half of that data transfer, and the other thing is to export it from the MySQL database. There are many reasons why we need to export the data. One important reason is to back up the database. The cost of data is often expensive and needs to be handled with care. Backing up frequently can help prevent the loss of valuable data, and another reason is that you might want to export the data to share. In this growing world of
-logs.Mysqldump-uroot-p--all-databases--flush-logs--flush-privilegesAfter exporting the MySQL database, issue a flush privileges statement. For proper recovery, this option should be used at any time to export the MySQL database and rely on MySQL database data.Mysqldump-uroot-p--all-databases--flush-privileges--forceIgnores the SQL errors that occur during the export process.Mysqldump-uroot-p--all-databases--force--helpDisplays help information and exits.Mysqldump--help--hex-blobExport binary st
Use mysqldump to export a database
Mysqldump is a client program used by mysql to store databases. It mainly produces a series of SQL statements that can be encapsulated into a file. This package contains all the SQL commands required to reconstruct your DATABASE, such as CREATE DATABASE, CREATE TABLE, and INSERT. It can be used for lightweight fast migration or database recovery. It is a logical backup met
Mysqldump back up and restore a MySQL database
Brief Introduction:
The mysqldump command can be used to export all specified databases and tables as SQL scripts, which can be used on Mysql in different sections. For example, to upgrade the Mysql database, you can use mysqldump to back up all the databases and then impo
MySQL has a lot of ways to import data, but these are only half of that data transfer, and the other thing is to export it from the MySQL database. There are many reasons why we need to export the data. One important reason is to back up the database. The cost of data is often expensive and needs to be handled with care. Backing up frequently can help prevent the loss of valuable data, and another reason is that you might want to export the data to share. In this growing world of information tec
backup!
Second, mysqldump logical backup DATABASE (full backup + increase backup, relatively slow, suitable for small database) (MyISAM is warm backup, InnoDB is hot backup)Logical backup steps:Backup:1. Choose to use Mysqldump–f (flush-logs) to back up data when the system is idle, such as at nightLibrary.# mysqldump–u root–p*** pointcard–f > Pointcard.s
databasename tablename >/home/db/db_bak2012where-u-p and MySQL parameters are the same, representing the user name and password, followed by the database name and indicate,> after the path to be exported.The above export data to import the database when you can enter MySQL, and then use the following command to implementsource/home/db/db_bak2012PS: This method is to export the entire table data, and with the build table information, if the imported database has the same name of the table, will
from the data. This tool reverses all the designs in your database. Because everything is contained in a text file. This text file can be imported back to MySQL using a simple batch processing and a suitable SQL statement. This tool is incredibly simple and fast. There will never be a headache.
Therefore, if you load the content of the entire database eays_studio to a file, you can use the following command:Go to DoS (if you have set the environment variable) mysql-uroot-P eays_studio> D:/bac
one. mysql backup command:1. Backing up a single databasemysql> system mysqldump-uroot-pmybaby99 WordPress >/tmp/wordpress.sql;mysql> system Ls-l/tmp/wordpress.sql;-rw-r--r--1 root root 292760 Oct 18:43/tmp/wordpress.sql2. Compress the backup:[Email protected] mysql]# mysqldump-uroot-pmybaby99 wordpress|gzip >/server/bak/wordpress.sql.gz;[Email protected] mysql]# ll-l/server/bak/wordpress.sql.gz-rw-r--r--1
the MySQL database, issue a flush privileges statement. For proper recovery, this option should be used at any time to export the MySQL database and rely on MySQL database data.Mysqldump-uroot-p--all-databases--flush-privileges--forceIgnores the SQL errors that occur during the export process.Mysqldump-uroot-p--all-databases--force--helpDisplays help information and exits.Mysqldump--help--hex-blobExport binary string fields using hexadecimal format. This option must be used if you have binary d
Scenario: Two database hosts a, B. After a global backup of host a data, new data (self-modifying table information) is generated, and the full backup file of host A and the binary log file are sent to Host B to complete the backup. Experiment Preparation:① two hosts to install MySQL or mariadb-server② turn on the binary logging feature (default off)Methods: Vim/etc/my.cnf.d/server.cnf #安装方式不同, the path will be different, this article with Yum installation explainedAdd under [Server] or [mysqld
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.