我使用了mysql 5.7.16社区和centos 7。
我正在关注视频tutorial安装mysql:
启动mysql后,我可以看到状态为service mysqld status
的活动(正在运行)。
但我可以'得到任何东西:grep 'temporary password' /var/log/mysqld.log
msyqld.log(忽略普通日志):
[Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists.
mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists.
mysqld: Table 'mysql.gtid_executed' doesn't exist
[Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
[Warning] InnoDB: Cannot open table mysql/server_cost from the internal data dictionary of InnoDB though the .frm file for the table exists.
[Warning] Failed to open optimizer cost constant tables
[Warning] InnoDB: Cannot open table mysql/time_zone_leap_second from the internal data dictionary of InnoDB though the .frm file for the table exists.
[Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
[Warning] InnoDB: Cannot open table mysql/servers from the internal data dictionary of InnoDB though the .frm file for the table exists.
[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
感谢任何帮助!
答案 0 :(得分:6)
我想出来了。
关键是需要手动删除/ var / lib / mysql。
答案 1 :(得分:3)
如果没有密码,请不要担心。 做吧。
sudo mysql_secure_installation
如果没有密码,请按Enter。
答案 2 :(得分:3)
我只是重新启动mysql并搜索:
service mysqld start
grep 'temporary password' /var/log/mysqld.log
显示了默认密码。