1、创建数据库:
create database bt_auth_bo;
2、创建用户:
create user 'bt'@'localhost' identified by '!@#密码';
create user 'bt'@'%' identified by '!@#密码';
备注:localhost本机ip,%任何ip
3、配置权限(8.0以上):
grant all privileges on bt_auth_bo.* to bt@'%';
flush privileges;
3、配置权限(8.0以下):
grant all privileges on bt_auth_bo.* to bt@'%' identified by '!@#密码';
flush privileges;
caching_sha2_password 报错,重新设置密码
ALTER USER 'bt'@'%' IDENTIFIED WITH mysql_native_password BY '!@#密码';
ALTER USER 'bt'@'localhost' IDENTIFIED WITH mysql_native_password BY '!@#_';
flush privileges;
windwow mysql远程访问
http://t.zoukankan.com/tenghoo-p-mysql_grant.html
1、mysql -u root -p
2、use mysql
3、GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
4、flush privileges;
5、select host,user from user;
文档更新时间: 2022-12-20 18:53 作者:admin