Skip to content

MySQL 5.7 on Centos 7

MySQL is the go-to guy of databases. It is the bees knees, the one and the only — it is the mother, father, and son of the entire open source Relational Database Management System (RDBMS) universe. However, it has lost some of its tang when Oracle purchased it in 2010. I was one of those who strongly resented the acquisition but what the hey, business is business. Anyway, this post is all about MySQL5.7 installation in Centos 7. This shouldn’t be a problem if you are using Centos 6 or other Linux distributions but in Centos 7, it is a totally different ballgame because in the latest stable release of this distribution, MySQL is no more. It is replaced by MariaDB — a MySQL fork by the same guys who built MySQL in the first place. Now, you understand why I resent Oracle.

Here are the steps to install MySQL 5.7 in Centos 7:

Step 1: Download the rpm package

[root@lappy]$ wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

Step 2: Check whether or not the hash codes match

[root@lappy]$ md5sum mysql57-community-release-el7-9.noarch.rpm

This should be equal to the hashcode provided in the MySQL website (MD5: 1a29601dc380ef2c7bc25e2a0e25d31e).

Step 3: Install the package

[root@lappy]$ sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm

Step 4: Install MySQL

[root@lappy]$ sudo yum localinstall mysql-server

Step 5: Start MySQL 5.7

[root@lappy]$ service mysqld start

Step 6: Check out the MySQL 5.7 temporary root password

[root@lappy]$ sudo grep ‘temporary password’ /var/log/mysqld.log

Take note of the password at the end of the line.

Step 7: Configure MySQL 5.7

[root@lappy]$ sudo mysql_secure_installation

This will ask you to change the root password. Note: The strict implementation of MySQL requires 12 characters minimum with one uppercase character and a special character for passwords.

Step 8: Check the version

[root@lappy]$ mysql -u root -p –version

Step 9: Change the Root Password

mysql > ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘MyNewPass’;

OR

mysql > SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘MyNewPass’);

Then

mysql > FLUSH PRIVILEGES;

Conclusion

Gammu requires MySQL not MariaDB to operate. Maybe in the future it will have connectors for the latter but for now, MySQL is the go to guy for Gammu implementations.

Comments are closed.