Installing MySQL 5.7 on CentOS 6

Installing the MySQL repository

[[email protected] ~]# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
[[email protected] ~]# rpm -ivh mysql57-community-release-el6-7.noarch.rpm

Install MySQL server and client

[[email protected] ~]# yum install -y mysql-community-client mysql-community-server

Starting MySQL

[[email protected] ~]# service mysqld start

We are looking for a password in the log file

[[email protected] ~]# grep -i temporary /var/log/mysqld.log

Connect to MySQL using the password from the log file

[[email protected] ~]# mysql -uroot -p

Change the root password

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Yourpassword1!');
Sidebar