1.docker 安装好后,mysql 进不去的话
得用跳表进去改密码
mysqld --skip-grant-tables --shared-memory ,这个shared 一定要,不然无法操作权限,他会提示
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
这样的错误。
2.进去mysql里面后 修改密码,因为是8.0的,要用
ALTER USER ‘root’@‘%’ IDENTIFIED BY ‘12345’;
如果直接这样,他会出现字符编码问题,这样修改密码不行
3、要用本地字符模式
ALTER USER ‘root’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘12345’;
这样才能成功