创建用户

1
create user 'tone'@'%' identified by '123123'

授权

1
2
3
4
5
6
grant all privileges on *.* to 'tone'@'%' with grant option;

// 授权 并且设置远程访问
GRANT ALL ON *.* TO 'root'@'%';
// GRANT ALL ON 表示所有权限,% 表示通配所有 host,可以访问远程。
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你自己的密码';

权限刷新

1
flush privileges;

数据库时区

1
show VARIA<!--autointro-->