在Linux6.5系統中,安裝MySQL5.7需要經過以下步驟:
1. 下載并安裝MySQL官方的Yum Repository:
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm sudo rpm -ivh mysql57-community-release-el6-11.noarch.rpm
2. 安裝MySQL Server和Client:
sudo yum install mysql-community-server mysql-community-client
3. 啟動MySQL服務:
sudo service mysqld start
4. 設置MySQL的root賬戶密碼:
sudo /usr/bin/mysql_secure_installation
5. 登錄MySQL:
mysql -u root -p
6. 創建新的MySQL用戶:
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
7. 給新用戶授權:
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
8. 刷新權限:
FLUSH PRIVILEGES;
現在在Linux6.5上安裝MySQL5.7就完成了。你可以使用新用戶登錄并開始使用MySQL了。