Mysql automatic backup

Source: Internet
Author: User
Tags mysql automatic backup

Mysql automatically backs up a series of problems. The test environment has finally been set up .. The server selected the MySQL-server-5.5.28 and the KEY verification information passed. It seems that the system is not installed correctly.

Start Database:/etc/init. d/mysql start; start test: connect to mysql first:> mysql-u root-p the initial password is blank and press Enter. Create database weixin; select this database: USE weixin; create table: create table info (Id int not null AUTO_INCREMENT, name int, info int, Ts TIMESTAMP, primary key (Id ));

 

Note that there can be only one AUTO_INCREMENT. You can only have one primary key. 3. troubleshooting 1.
 ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

 

In the user table of the mysql database, an account with an empty username is an anonymous account. As a result, the user logs on to the database anonymously, even though the user name is root, you can see method 1 through the '@ 'localhost' in the error message:
1. disable mysql # service mysqld stop2. block permission # mysqld_safe -- skip-grant-table: Starting demo from ..... 3. start a new terminal and enter # mysql-u root mysql> UPDATE user SET Password = PASSWORD ('newpassword') where USER = 'root'; mysql> flush privileges; // remember this sentence. Otherwise, if you close the previous terminal, the original error mysql> \ q will appear.

 

Method 2:
1. disable mysql # service mysqld stop2. block permission # mysqld_safe -- skip-grant-table: Starting demo from ..... 3. start a new terminal and enter # mysql-u root mysql> delete from user where USER = ''; mysql> flush privileges; // remember this sentence, otherwise, if you close the previous terminal, the original error mysql> \ q will appear.

 

2. You cannot back up your own database at the beginning. After adding the ROOT password, the database is backed up successfully. Password settings:
UPDATE user SET Password=PASSWORD('newpassword') where USER='root';

 

Backup statement:
mysqldump -u root -p111 weixin > /usr/mysqlbak/1.sql

 

 

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.