CentOS 7.0yum installation MySQL
1. Download the MySQL repo source
$ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2. Install the MYSQL-COMMUNITY-RELEASE-EL7-5.NOARCH.RPM package
$ sudo rpm-ivh mysql-community-release-el7-5.noarch.rpm
After installing this package, you will get two MySQL yum repo Source:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo.
3. Install MySQL
$ sudo yum install Mysql-server
Follow the prompts to install, but there is no password after installation, you need to reset the password
4. Reset MySQL Password
$ mysql-u Root
Note: This error may be reported at login: Error 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2), the reason is/ Var/lib/mysql access rights issues.
5. The following command changes the owner of the/var/lib/mysql to the current user:
$ sudo chown-r root:root/var/lib/mysql
6. Restart the MySQL service
$ Service Mysqld Restart
7. Next Login to reset Password:
$ mysql-u root//Direct enter into MySQL console
mysql > Use MySQL;
MySQL > Update user set Password=password (' 123456 ') where user= ' root ';
MySQL > exit;
CentOS 7.0yum installation MySQL