关于文章 mysql8

install linux mysql mysql8

mysql 8.x 安装略有不同 记录一下

linux安装mysql 8.x

mysql 8.x 安装与 5.x 略有不同 这里大概记录一下

my.ini

[mysqld]

port=3306

max_connections=200
max_connect_errors=10
character-set-server=utf8
default-storage-engine=INNODB
default_authentication_plugin=mysql_native_password
[mysql]
default-character-set=utf8
[client]
port=3306
default-character-set=utf8

初始化

./bin/mysqld --initialize

复制出密码来

//修改root的密码

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';  

//创建新用户

CREATE USER 'free'@'%' IDENTIFIED WITH mysql_native_password BY 'free';

// 授权所有权限

GRANT ALL PRIVILEGES ON *.* TO 'free'@'%';

// 授权部分

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON *.* TO 'free'@'%';