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