Notes for backing up MySQL in Linux

Source: Internet
Author: User

After one day of trial, MySQL backup tools in Linux cannot be used for backup. Now we will record the backup steps in detail.

Using SQLyogEnt to back up data may cause problems due to a large amount of data, which has caused me many times and is prone to errors. It is good to back up data using the mysql tool. The procedure is as follows:

1. First Use the SQLyogEnt tool to connect to the mysql server

2. Edit the password of the root-localhost user.

3. Create a directory on the Linux server to store the backup file/backdata/

Cd/usr/local/mysql/bin/
Mysqldump-u username-p password -- databases Database Name>/backdata/ddd07-11-15. SQL

Restore syntax
Mysqladmin create target_db_name

Mysql target_db_name <backup-file. SQL

That is, the mysql database name <file name

OK. Note that there is no space behind-u. You just need to replace the above Chinese with your related information!

The following are SQL statements related to game zones. They are written by Su Feng and need to be improved.
Modification on the account Server

Update 'accessstore000000' set ACCOUNT = Rtrim (ACCOUNT) + '2q'

Find the largest UID on the server in another zone.
SELECT max (UID) FROM 'accessstore000000'

For example, 1000066668.

Then replace
Update 'accessstore000000' set UID = UID + 1000066668

-------------------------
Modify on the game server

Update CHARBASE set name = CONCAT (rtrim (name), '1q ')
Update 'charbase' set ACCID = ACCID + 1000066668

Update 'army' set NAME = Rtrim (NAME) + '2q'
Update 'army' set GENNAME = Rtrim (GENNAME) + '2q'

It seems that GENID also needs to be modified. The modification method is the same as UID, and the maximum value of the other server must be added.
-------------------------

Update ''balance ''set ACCOUNT = Rtrim (ACCOUNT) + '2q'
Update ''balance ''set ACCID = ACCID + 1000066668

Other tables to be modified are processed in the same way.

If the name is the same, first import the name of the person in the other area to the database of the region to be modified.
Where name not in (select name from table name)

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.