mysqld.log中没有临时密码

Fur*_*egg 4 passwords temporary centos7 mysql-5.7

我使用了mysql 5.7.16社区和centos 7.

我正在关注安装mysql 的视频教程:

  1. wget http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
  2. yum localinstall dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
  3. 启用yum repolist | grep" mysql.-community. "
  4. yum install mysql-community-server
  5. 服务mysqld启动

启动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
Run Code Online (Sandbox Code Playgroud)

感谢任何帮助!

小智 8

如果没有密码,请不要担心。做吧。

sudo mysql_secure_installation
Run Code Online (Sandbox Code Playgroud)

只需按回车键,因为您没有密码。


Fur*_*egg 7

我想通了.

  1. 我选择mysql安装centos 7,mysql版本是5.5.
  2. 删除它:yum删除mysql-serverl.
  3. 本教程安装5.7.16.
  4. 有这些错误.
  5. 百胜删除mysql-community-server,再次安装5.7.
  6. 还是有这些错误.
  7. Yum删除mysql-community-server,但删除dir/var/lib/mysql.
  8. 然后重新安装,它的工作原理.

关键点是需要手动删除/ var/lib/mysql.

  • 谢谢,删除 `/var/lib/mysql` 并重新安装 mysql 为我做到了! (2认同)

小智 6

我只是重新启动了 mysql 并进行了搜索:

service mysqld start

grep 'temporary password' /var/log/mysqld.log
Run Code Online (Sandbox Code Playgroud)

显示默认密码。