1. 程式人生 > >安裝mysql8.0.11

安裝mysql8.0.11

mysql8.0.11

1、安裝依賴關系

yum -y install openssl-devel
yum install perl-JSON

2、安裝mysql(要一起安裝)

rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpm
mysql-community-devel-8.0.11-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.11-1.el7.x86_64.rpm
mysql-community-libs-8.0.11-1.el7.x86_64.rpm
mysql-community-server-8.0.11-1.el7.x86_64.rpm
mysql-community-client-8.0.11-1.el7.x86_64.rpm
mysql-community-test-8.0.11-1.el7.x86_64.rpm

3、查看密碼

grep ‘temporary password‘ /var/log/mysqld.log

4、登陸後重新設置root密碼

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘Fan2018!‘;

5、創建用戶

CREATE USER ‘fangx‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘Fan2018!‘;

#(需要註意:mysql8.0加密方式修改了)
#檢查用戶

select user, host, plugin, authentication_string from user\G;

6、授權遠程數據庫

#授權所有權限 
GRANT ALL PRIVILEGES ON *.* TO ‘fangx‘@‘%‘;
 #授權基本的查詢修改權限,按需求設置
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO ‘fangx‘@‘%‘;

7、查看用戶權限
show grants for ‘fangx‘@‘%‘;

安裝mysql8.0.11