1.安裝MySQL
yum install mysql mysql-server
複製程式碼
2.啟動MySQL
service mysqld start
複製程式碼
3.配置MySQL
/usr/bin/mysql_secure_installation
複製程式碼
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
複製程式碼
4.連線MySQL
mysql -uroot -pyourpassword
複製程式碼
5.建立可以外部連線的使用者
create user IDENTIFIED BY 'password'
複製程式碼