命令行打开数据库
create user ‘hag’@‘%’ identified by ‘HagSoft@123’;//创建一个可远程登陆账户
ALTER USER root@localhost IDENTIFIED BY ‘HagSoft@123’;//更改本地root用户登录密码
alter user’hag’@‘%’ IDENTIFIED BY ‘HagSoft@123’;//更改账户密码
grant all privileges on . to ‘hag’@‘%’ with grant option;//允许任何ip通过hag账户进行远程连接
grant all privileges on . to ‘hag’@‘localhost’ with grant option;//赋予hag本地账户任何权限
flush privileges;//MySQL用户数据和权限有修改后,希望在”不重启MySQL服务”的情况下直接生效
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘HagSoft@123’ PASSWORD EXPIRE NEVER;//设置密码永不过期
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘HagSoft@123’;//设置密码加密模式为mysql_native_password
FLUSH PRIVILEGES;
My.ini修改如下:
屏蔽
#log-bin=“DESKTOP-QJAJH0D-bin” //binlog相关
添加:
skip-log-bin //binlog相关
log_statements_unsafe_for_binlog=0
event_scheduler = 1 //开启事件调度器
修改my.ini文件后保存格式为ANSI编码格式。
datadir=C:/ProgramData/MySQL/MySQL Server 8.0\Data