ubuntu 18 系统安装mysql 8.0(deb-bundle包)

1、ubuntu 18 

2、安装

1 sudo dpkg -i mysql-common_8.0.11-1ubuntu18.04_amd64.deb

sudo apt-get update
2 sudo dpkg -i libmysqlclient21_8.0.11-1ubuntu18.04_amd64.deb
sudo apt-get update
3 sudo dpkg -i libmysqlclient-dev_8.0.11-1ubuntu18.04_amd64.deb
sudo apt-get update
4 sudo dpkg -i mysql-community-client-core_8.0.11-1ubuntu18.04_amd64.deb
sudo apt-get update
5 sudo apt-get install libaio1 libmecab2 openssh-client
sudo apt-get update
6 sudo dpkg -i mysql-community-server_8.0.11-1ubuntu18.04_amd64.deb
sudo apt-get update
7 sudo dpkg -i mysql-community-client_8.0.11-1ubuntu18.04_amd64.deb
sudo apt-get update
8 sudo dpkg -i mysql-client_8.0.11-1ubuntu18.04_amd64.deb
sudo apt-get update
9 sudo dpkg -i mysql-community-server-core_8.0.11-1ubuntu18.04_amd64.deb
sudo apt-get update
10 sudo dpkg -i mysql-server_8.0.11-1ubuntu18.04_amd64.deb

sudo apt-get update

 

 

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'@'%';

 

 

 

你可能感兴趣的:(SQL)