Export and Import mysql Data in linux
Export all data in the entire database
1. Enter the following in the linux Command Line:
mysqldump -u userName -p dabaseName > fileName.sql
FileName. It is best to add the path name to SQL.
Export the data
Mysql master-slave synchronization error solution: This article is fromLinux O & M training for Old BoysSummary of internal teaching plan contentFAQ: Question 1: mysqldump: Got error: 1556: You can't use locks with log tables.
When the old boy took
From: http://blog.csdn.net/xiaoyu411502/article/details/5319232
First, use the mysqldump command only if you enter the bin directory under the MySQL installation directory in cmd.My MySQL is installed on the E: disk. Therefore, first go to the bin
The shell script is a script that we write different types of commands that can be executed in this file. We can also
A typing command is performed manually. If we're going to use a shell script, we have to write these commands in a text file at
In order to ensure data security, the data needs to be backed up regularly. There are a number of ways to backup, and the effect is different. Once there is an error in the data in the database, you need to use the backed-up data for restore
Now most of the virtual host has automatic backup function, but sometimes can not rely on the host is not, if the host is black, even backup files can not be restored, then cry miserably, so that people are inferior to rely on their own. Today 111cn.
The scope of this article: a comprehensive description of MySQL database operations, divided into virtual host and server two situations.
Virtual Host
1, through the phpMyAdmin import and export function, this software generally only supports the
Dump command Backup
1. Back up a database:
Mysqldump-uroot (Root is User name)-P-Database (library name) table (table name) >d:\backup.sql (where to back up, file name)
2. Back up multiple databases: (plus the--databases option, followed by
1. Requirements overview
Back up MySQL database data 00:00 every day;
Each library generates a file, using gzip compression, file name: Backup_ Library Name _yyyymmdd. sql.gz, note that YYYYMMDD need to be the day before;
Save the
Suppose our target database is test and the table is user.Assume that the user name and password for MySQL are root.The programs used for backup and recovery are the mysqldump commands and MySQL commands provided by the MySQL package. The idea is
Http://c.biancheng.net/cpp/html/1458.htmlThe mysqldump command is used to back up the database. The mysqldump command executes under the DOS [Url=file://\\mysql\\bin]\\mysql\\bin[/url] directory. 1) Export the entire database (the export file is
From the virtual host over to the VPS, the general webmaster may feel that the cost of operation and maintenance time is relatively large. For example, in the VPS maintenance, backup data, in the absence of the use of regular automatic backup
Export:Through the command line in the directory of the bin folder in MySQLInput: D:\phpstudy\mysql\bin>mysqldump-uroot-p database name > exported file nameImport:Need to enter mysql> firstInput: Mysql>use database nameMysql>source the file name of
Method OneCMD to the MySQL Bin directory with the following command mysqldump--opt-h192.168.0.156-uusername-ppassword--skip-lock-tables databasename> Database.sqlYou can change the IP to localhost.It's even easier if you have navicate. Connect to
MySQL常用指令,java,php程序员,数据库工程师必备。程序员小冰常用资料整理MySQL common commands (for reference)The most common display commands are:1. Display the list of databases.show databases;2. Display the data table in the library:Use MySQL;Show tables;3, display the
MySQL5.6 and the following version, after installation by default comes with a test database, and in MySQL5.6, Mysql.user user table with user name is empty user, and so on the default settings, these are unsafe, easy for others to take advantage of
1. Connect Server Login>mysql-h 192.168.0.11-u Root-p2. Modify User Password>mysqladmin-u root-p 654321 Password 1234563. User Rights Management1) The grant command is used to add new users and control their permissions.Grant
MySQL is a relational database management system, because of its small size, fast, low total cost of ownership, especially the open source of this feature, the general development of small and medium-sized web sites have chosen MySQL as a Web site
Backing up a database using mysqldump
1. Backing up a database
mysqldump--user [user name] --password=[password] [database name] > [dump file]
Or
Mysqldump-u[user name]-p[password] [database name] > [dump file]
Example:
Logical backup: Common Operations, case studies, causes of unexpected termination, and solutions (I) Common Operations ① full-Database Backup Syntax: mysqldump-h host name-P port-u user name-p password (-database) database Name> file name. SQL
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.