1.新建my.ini(注意文件编码)
[mysql]
port = 13307
default-character-set=utf8mb4
[mysqld]
port = 13307
basedir=D:\mysql-8.0.14-master
datadir=D:\mysql-8.0.14-master\data
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
character-set-server=utf8mb4
performance_schema_max_table_instances=600
table_definition_cache=400
2:mysqld --defaults-file=D:\mysql-8.0.14-slave\my.ini --initialize --console
3.mysqld install mysql_slave --defaults-file="D:\mysql-8.0.14-slave\my.ini"
des:忘记密码
新建Repweat_pwd.txt
Repweat_pwd.txt内容:
ALTER user root@'localhost' identified by '密码';
4.mysqld --defaults-file="D:\mysql-8.0.14-slave\my.ini" --init-file="D:\mysql-8.0.14-slave\Repweat_pwd.txt"
使用123456密码登录,进入修改
!!! 移除服务:mysqld -remove 名字
5.开启远程服务
CREATE USER 'root'@'%' IDENTIFIED BY '密码';
GRANT ALL ON *.* TO 'root'@'%';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';
FLUSH PRIVILEGES;