- How To Install MySQL on CentOS 7
- 2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository
- A Quick Guide to Using the MySQL Yum Repository
การดาว์นโหลดตัวติดตั้ง
ไปที่ MySQL Community Downloads แล้วเลือก MySQL Yum Repository
แล้วดาว์นโหลดไฟล์ mysql80-community-release-el7-3.noarch.rpm
ถ้าใช้ไฟล์ mysql80-community-release-el7-5.noarch.rpm
ก็เป็น mysql57
การติดตั้ง
sudo rpm -ivh mysql80-community-release-el7-3.noarch.rpm
การเลือกเวอร์ชันที่จะติดตั้ง
sudo yum-config-manager --disable mysql80-community sudo yum-config-manager --enable mysql56-community
หรือ เลือก enabled=1 ที่ไฟล์ /etc/yum.repos.d/mysql-community.repo
ตรวจสอบว่า enabled ถูกเวอร์ชันมั๊ย
yum repolist enabled | grep mysql
sudo yum install mysql-server -- OR -- sudo yum install mysql-community-server
Starting MySQL
sudo systemctl start mysqld
sudo systemctl status mysqld
uring the installation process, a temporary password is generated for the MySQL root user. Locate it in the mysqld.log
with this command:
sudo grep 'temporary password' /var/log/mysqld.log
Configuring MySQL
sudo mysql_secure_installation