Here is how to install MySQL on CentOS. At the end of the install grab the
root temporary password and change it with your new password.
# Remove mariadb-libs which conflicts with MySQL packages sudo yum remove -y mariadb-libs # Download mysql rpm and add to yum repo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm -P /tmp sudo rpm -ivh /tmp/mysql80*.noarch.rpm # Install the MySQL packages, enable and start mysqld sudo yum -y install \ mysql-devel \ mysql-server sudo systemctl enable mysqld sudo systemctl start mysqld # Update temporary mysql password echo "========== temporary root password ============" sudo grep 'temporary password' /var/log/mysqld.log|awk {'print $NF'} echo "===============================================" echo echo "Use the above password to change the root password." sudo mysql_secure_installation
When the script asks you the root password, supply the temporary password.
For example, for me, it was “z<CA*2uHIdr5”. Then change it to your own password.