Install CentOS for MySQL databases in CentOS
The predecessors always said that they should learn and record while summing up. Therefore, we started to record the 1.1 points learned every day.
Complex theories are not understood. they will only be installed currently. after the installation, you will start playing!
1. download the corresponding rpm installation package from the official website.
: Http://dev.mysql.com/downloads/mysql/5.6.html#downloads
For example, I only downloaded these three files.
2. you will use the rpm command for installation (relatively familiar)
In fact, this should be step 1.
#rpm -ivh MySQL-client-5.6.19-1.el6.i686.rpm#rpm -ivh MySQL-devel-5.6.19-1.el6.i686.rpm#rpm -ivh MySQL-server-5.6.19-1.el6.i686.rpm
Enter (restart database) after installation: service mysql restart
Error: mysql unrecognized service
The reason is that mysql was not deleted before ~~ Delete it!
3. delete the original mysql
First, find the original rpm-qa | grep mysql
Delete the preceding three items one by one:
After deletion, go back to step 2 and reinstall.
4. modify the root password (this root account is the root account of mysql, not the root account of Linux ).
Change password input: # mysqladmin-u root password 'root'
Then an error occurs)
Error: 'Access denied for user' root' @ 'localhost''
And then Baidu. use the following method to solve the problem:
# Service mysql stop # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking & # mysql-u root mysqlmysql> UPDATE user SET Password = PASSWORD ('newpassword (SET new password) ') where USER = 'root'; mysql> flush privileges; mysql> quit #/etc/init. d/mysql restart # mysql-uroot-pEnter password:
<输入新设的密码>
5. test whether the installation is successful:
Input: mysql> show databases;
The semicolon must be added; otherwise, an error is displayed.
However, even if I add a semicolon, an error occurs (T ^ T)
ERROR 1820 (HY00): You must set password before executing this statement
I once again witnessed the strength of Baidu
Input: mysql> set password = PASSWORD ('2017 (your PASSWORD )');
Reset the password!
Then, it seems like you can ~~