In other words, this installation of MySQL is really twists, did not expect such trouble. I installed it with Yum Source and first provided some things to install MySQL with yum.
Must be well equipped with Yum source, yum source problems can be referred to my previous blog content
1. Install MySQL
Yum Install Mysql-server--This must be mysql-server, not yum install Mysql,mysql-server is the service End, you can use Yum search MySQL to view some of the contents of the Yum source about MySQL.
2. Start MySQL
/etc/init.d/mysqld start
3. Set the password for the root user
Mysql-uroot-p--An error.
Linux MySQL 5.6:error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Workaround:
A, first stop MySQL
/etc/init.d/mysqld stop
B
[[email protected] init.d]# mysqld_safe--user=mysql--skip-grant-tables--skip-networking &--skip Permission table and network protocol
[Email protected] init.d]# 1 mysqld_safe Logging to '/var/lib/mysql/db-server.err '.
140722 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql
Here you can just ctrl +c, then proceed to the next step.
C, mysql-u root mysql--enter MySQL
Mysql>update user Set Password=password (' 123456 ') where user= ' root ' and host= ' root ' or host= ' localhost ';
mysql> flush Privileges;
Mysql> quit
/etc/init.d/mysqld Restart--restart MySQL
Mysql-u Root-p will be able to set a new password.
MySQL installation on Linux operating system