Backup recovery of MySQL database and garbled problem continued

Source: Internet
Author: User
Tags add character set log sql mysql query mysql database backup
After I go to WordPress, the first consideration is its database backup recovery problem, because write Bloger know, their blog records are all the valuable information and text they need, if because of various unknown factors leading to the database crash or space business out of the problem, lost data, is undoubtedly a very great pain and loss.

So in my blog there are several data articles or their own ideas to discuss the MySQL database backup recovery and garbled problem.

The results of the previous article discussions have been able to meet my database backup and recovery problems for a while, but there is always a place that I can not be completely relieved, that is, using PMA recovery, the use of the upload mechanism, then the default PHP is the largest upload 2M, if I blog to write down, wrote a few years, What should I do if the backup data is over 2M?

When I was basking in the sun this afternoon, I thought of the problem, but I suddenly remembered that I could not choose to back up that watch when I backed up. Oh, "Being loving", in fact, a large amount of data, I can completely save a table, and then a table recovery, which is equivalent to a compressed packet into several, so that the volume of each part of the reduction. Oh, the heart and comfortable some. But the problem again, WP's log is placed in the Wp_posts table, even if other such as options, comments and other tables are only a small part, if the posts table data more than 2M?

Do not know if I am unfounded, 2M gzip file can save n days of log. But as the saying goes, good, in danger, thinking is prepared, preparedness! And then I think, if I don't save as gzip format, I will save the TXT file of SQL statements, and then I restore the point of Trouble, manual copy paste the SQL code, although more trouble points, but the recovery is no problem. Oh. I think it's a little bit more comfortable. At least you have a backup recovery problem that you don't have to worry about after the database gets big. : 0

In fact, I think if I concentrate on research, to write code, completely can write a WP database backup recovery program, unfortunately, I use WP itself is to lazy, with its huge resources to their convenience, because the work is too busy, if the above spend time to develop, I think I can not devote myself to work.

Of course, unless it is my blog to write the time is too long, the amount of data is too large, and are valuable information, I would like this demand below, I will write a perfect WP database backup recovery procedures.

Finally add the MySQL database garbled problem solution, data from a QQ group of WP users:

Finally solved the WordPress Chinese garbled problem

Refer to a lot of people's methods, and finally confirmed a bit. Summarized as follows:

1, MySQL Processing

(1) Configuration file processing

Delete the default-character-set=latin1 in My.ini

Some people like to change into Default-character-set=utf8, also line, I simply deleted, as long as the attention of the following 2 in the "finishing" on the OK! )

(2) phpMyAdmin processing

The settings are as follows:

1: Language set to Chinese (zh-utf-8)

2:mysql Character Set: UTF-8 Unicode (UTF8)

3:mysql Connection Proofing: Utf8generalci

4: When the new database and datasheet, the collation of the selection Utf8generalci

2, WordPress processing

In $THIS->DBH = @mysqlconnect ($dbhost, $dbuser, $dbpassword);

Next, add a sentence

$this->query ("Set names ' UTF8 '");

That is the following (only added this sentence, post, the text is normal!) ):

$this->DBH = @mysqlconnect ($dbhost, $dbuser, $dbpassword);

$this->query ("Set names ' UTF8 '");



Related Article

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.