安装mysql-5.7.32数据库时,初次登陆MySQL,执行如下命令获取临时密码,/var/log/mysqld.log 为my.cnf中log-error配置项的内容:
grep 'temporary password' /var/log/mysqld.log
获取临时密码:!.IRoNewC7xq,执行结果如下:
初次使用临时密码登录 MySQL,查看MySQL数据库时,出现如下问题:
原因是root用户没有设置密码,执行如下命令:
# 为 root 用户设置密码
set password=password("root");
# 刷新
flush privileges;
再次查看数据库,结果如下:
- statement executing password before ALTERstatement executing password before execution interrupted statement exceeded skip-grant-tables statement execute running lock_write_growth statement execute running declaration executable statement appear alter mysql-alter 机制alter alter hana user sql confirm prompt alter js