Installing MySQL on Centos:
From the link (https://dev.mysql.com/downloads/) select suitable package for corresponding operating system.
Example on CentOS7: mysql80-community-release-el7-3.noarch.rpm
Step1: Install the downloaded package.
> rpm -ivh mysql80-community-release-el7-3.noarch.rpm
This will add two new MySQL yum repositories, and we can now use them to install MySQL server
Verify by looking files in /etc/yum.repos.d/mysql*
Step2: This will update the yum repos.
yum update
Step3: Verify which version is enabled to get installed.
yum repolist all | grep mysql
Step4: Enable or Disable, by default latest is enabled.
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community
Installing 5.7 in our case.
Verify by: yum repolist enabled | grep mysql
Step5: Installing MySQL community server5.7
yum install mysql-community-server
Verify by, rpm -qa | grep mysql
Step 7: Start deamon
service mysqld start
Verify by service mysqld status
Step8: Get the temporary password for MySQL root user from the logs.
cat /var/log/mysqld.log | grep 'temporary password'
Step9: Login to the shell using the generated root user.
mysql -u root -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abc@123';
Note: By default "MySQL's validate_password(https://dev.mysql.com/doc/refman/8.0/en/validate-password.html)" plugin is installed, which requires at least one uppercase letter, one lowercase letter, one digit, and one special character, and that the total password length is at least 8 characters.
Step10: Final verification.
mysqladmin -u root -p version
This should return version installed.
***
No comments:
Post a Comment