CentOS7安裝 MySQL8
CentOS安裝 MySQL8
1、在MySQL官網(wǎng)中查找YUM源rpm安裝包: http://dev.mysql.com/downloads/repo/yum/?
2、下載rpm安裝包: wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
3、安裝mysql源: yum localinstall mysql80-community-release-el7-3.noarch.rpm
4、安裝mysql: yum install mysql-community-server
5、啟動mysql服務:? systemctl start mysqld
6、設置開機啟動: systemctl enable mysqld; systemctl daemon-reload;
7、查找初始密碼: grep 'temporary password' /var/log/mysqld.log
8、本地MySQL客戶端登錄: mysql -uroot -p
9、修改密碼: ALTER USER 'root'@'localhost' IDENTIFIED BY? 'password';
10、創(chuàng)建遠程用戶 CREATE USER 'name'@'%' IDENTIFIED BY 'password';
11、遠程用戶授權命令:GRANT privileges ON databasename.tablename TO 'username'@'host'
? ?GRANT ALL ON *.* TO 'username'@'%';
? ?ALTER USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
12、刷新用戶權限: flush privileges;
99、 徹底卸載mysql: yum remove mysql-community-server