【问题标题】:No temporary password in mysqld.logmysqld.log 中没有临时密码
【发布时间】:2017-03-26 11:13:08
【问题描述】:

我用过mysql 5.7.16社区和centos 7。

我正在关注tutorial安装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

感谢任何帮助!

【问题讨论】:

    标签: passwords centos7 temporary mysql-5.7


    【解决方案1】:

    我只是重启了mysql,搜索了一下:

    service mysqld start
    
    grep 'temporary password' /var/log/mysqld.log
    

    显示默认密码。

    【讨论】:

    • 您的解决方案很简单,而且效果很好!谢谢
    【解决方案2】:

    如果没有密码,别担心。 去做吧。

    sudo mysql_secure_installation
    

    没有密码,直接回车即可。

    【讨论】:

    • 谢谢,我认为 Centos 7 的密码会与 Fedora 同属一个家族
    【解决方案3】:

    我想通了。

    1. 我安装 centos 7 时选择了 mysql,mysql 版本是 5.5。
    2. 通过以下方式将其删除:yum remove mysql-serverl。
    3. 按照本教程安装 5.7.16。
    4. 有这些错误。
    5. yum 删除 mysql-community-server,重新安装 5.7。
    6. 仍然有这些错误。
    7. yum 删除 mysql-community-server,但删除目录 /var/lib/mysql。
    8. 然后重新安装,就可以了。

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

    【讨论】:

    • 谢谢,删除 /var/lib/mysql 并重新安装 mysql 为我做到了!
    猜你喜欢
    • 1970-01-01
    • 2014-04-03
    • 1970-01-01
    • 1970-01-01
    • 2021-03-21
    • 2013-09-08
    • 2011-12-12
    • 1970-01-01
    • 2021-12-07
    相关资源
    最近更新 更多