Learn how to install MySQL 5.7.20 on RHEL7 / CentOS7 with this easy-to-follow guide:
Step 1: Download the MySQL installation bundle with the following command:
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar
Step 2: Extract the bundle using the command:
tar -xvf mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar
Step 3: Install MySQL and its dependencies using the following command from the extracted directory:
yum -y install mysql-community-server-5.7.20-1.el7.x86_64.rpm mysql-community-common-5.7.20-1.el7.x86_64.rpm mysql-community-client-5.7.20-1.el7.x86_64.rpm mysql-community-libs-5.7.20-1.el7.x86_64.rpm
Step 4: Before proceeding, clean up the content of the /var/lib/mysql/* directory. If necessary, take a backup of the directory.
Next, initialize the MySQL database using the command:
mysqld --initialize --user=mysql
Start the MySQL service with the command:
service mysqld start
Step 5: Retrieve the temporary root password from the log using the command:
cat /var/log/mysqld.log |grep -i 'temporary password'
Step 6: Log in to MySQL as root using the temporary password and change the root password using the following commands:
mysql -u root -p Enter password: )eYlFY_xK0fX
alter user 'root'@'localhost' identified by 'newpassword';
Step 7: Exit MySQL using the command:
quit
That's it! Follow these steps and you'll have MySQL 5.7.20 up and running on your RHEL7 / CentOS7 system in no time.
No comments:
Post a Comment