0

0

MySQLStudy之--Mysql启动失败“mysql.host”

php中文网

php中文网

发布时间:2016-06-07 14:56:08

|

1421人浏览过

|

来源于php中文网

原创

MySQL Study之--Mysql启动失败“mysql.host” 系统环境 : 操作系统:RedHat EL55 DB Soft: Mysql 5.6.4-m7 通过源码包安装mysql后,在启动mysqld时出现错误: [root@rh55 mysql]# bin/mysqld_safe [1] 15846 [root@rh55 mysql]# 150610 17:04:36 mysqld_sa

MySQL Study之--Mysql启动失败“mysql.host”

系统环境

操作系统:RedHat EL55

DB Soft:  Mysql 5.6.4-m7


通过源码包安装mysql后,在启动mysqld时出现错误:

[root@rh55 mysql]# bin/mysqld_safe &
[1] 15846
[root@rh55 mysql]# 150610 17:04:36 mysqld_safe Logging to '/usr/local/mysql/data/mysql/rh55.err'.
150610 17:04:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/mysql
150610 17:04:37 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql/rh55.pid ended

[1]+  Done                    bin/mysqld_safe


查看mysql日志:


[root@rh55 mysql]# more /usr/local/mysql/data/mysql/rh55.err

MuleRun
MuleRun

全球首个AI Agent交易平台

下载
  1. 150610 16:56:59 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/mysql  
    /usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist  
    150610 16:57:00 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.  
    150610 16:57:00 InnoDB: The InnoDB memory heap is disabled  
    150610 16:57:00 InnoDB: Mutexes and rw_locks use InnoDB's own implementation  
    150610 16:57:00 InnoDB: Compressed tables use zlib 1.2.3  
    150610 16:57:00 InnoDB: CPU does not support crc32 instructions  
    150610 16:57:00 InnoDB: Initializing buffer pool, size = 128.0M  
    150610 16:57:00 InnoDB: Completed initialization of buffer pool  
    InnoDB: The first specified data file ./ibdata1 did not exist:  
    InnoDB: a new database to be created!  
    150610 16:57:00 InnoDB: Setting file ./ibdata1 size to 10 MB  
    InnoDB: Database physically writes the file full: wait...  
    150610 16:57:01 InnoDB: Log file ./ib_logfile0 did not exist: new to be created  
    InnoDB: Setting log file ./ib_logfile0 size to 5 MB  
    InnoDB: Database physically writes the file full: wait...  
    150610 16:57:02 InnoDB: Log file ./ib_logfile1 did not exist: new to be created  
    InnoDB: Setting log file ./ib_logfile1 size to 5 MB  
    InnoDB: Database physically writes the file full: wait...  
    InnoDB: Doublewrite buffer not found: creating new  
    InnoDB: Doublewrite buffer created  
    150610 16:57:04 InnoDB: 128 rollback segment(s) are active.  
    InnoDB: Creating foreign key constraint system tables  
    InnoDB: Foreign key constraint system tables created  
    150610 16:57:04 InnoDB: Waiting for the background threads to start  
    150610 16:57:05 InnoDB: 1.2.4 started; log sequence number 0  
    150610 16:57:05 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been  
     started. Generating a new UUID: ab19e2d2-0f4e-11e5-b157-080027973e8a.  
    150610 16:57:05 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist  
    150610 16:57:05 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql/rh55.pid ended  
    150610 17:04:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/mysql  
    /usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist  
    150610 17:04:36 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.  
    150610 17:04:36 InnoDB: The InnoDB memory heap is disabled  
    150610 17:04:36 InnoDB: Mutexes and rw_locks use InnoDB's own implementation  
    150610 17:04:36 InnoDB: Compressed tables use zlib 1.2.3  
    150610 17:04:36 InnoDB: CPU does not support crc32 instructions  
    150610 17:04:36 InnoDB: Initializing buffer pool, size = 128.0M  
    150610 17:04:36 InnoDB: Completed initialization of buffer pool  
    150610 17:04:36 InnoDB: highest supported file format is Barracuda.  
    InnoDB: Log scan progressed past the checkpoint lsn 48961  
    150610 17:04:36  InnoDB: Database was not shut down normally!  
    InnoDB: Starting crash recovery.  
    InnoDB: Reading tablespace information from the .ibd files...  
    InnoDB: Restoring possible half-written data pages from the doublewrite  
    InnoDB: buffer...  
    InnoDB: Doing recovery: scanned up to log sequence number 1595695  
    150610 17:04:36  InnoDB: Starting an apply batch of log records to the database...  
    InnoDB: Progress in percents: 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76  
     77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99   
    InnoDB: Apply batch completed  
    150610 17:04:37 InnoDB: 128 rollback segment(s) are active.  
    150610 17:04:37 InnoDB: 1.2.4 started; log sequence number 1595695  
    150610 17:04:37 [Note] Recovering after a crash using mysql-bin  
    150610 17:04:37 [Note] Starting crash recovery...  
    150610 17:04:37 [Note] Crash recovery finished.  
    150610 17:04:37 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist  
    150610 17:04:37 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql/rh55.pid ended

查看mysql配置文件:
[root@rh55 ~]# cat /etc/my.cnf

[mysqld]  
port            = 3306  
socket          = /tmp/mysql.sock  
skip-external-locking  
key_buffer_size = 16M  
max_allowed_packet = 1M  
table_open_cache = 64  
sort_buffer_size = 512K  
net_buffer_length = 8K  
read_buffer_size = 256K  
read_rnd_buffer_size = 512K  
myisam_sort_buffer_size = 8M  
datadir=/usr/local/mysql/data/mysql

解决方案:
[root@rh55 mysql]# scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql

  1. WARNING: The host 'rh55' could not be looked up with resolveip.  
    This probably means that your libc libraries are not 100 % compatible  
    with this binary MySQL version. The MySQL daemon, mysqld, should work  
    normally with the exception that host name resolving will not work.  
    This means that you should use IP addresses instead of hostnames  
    when specifying MySQL privileges !  
    Installing MySQL system tables...  
    150610 17:07:10 InnoDB: The InnoDB memory heap is disabled  
    150610 17:07:10 InnoDB: Mutexes and rw_locks use InnoDB's own implementation  
    150610 17:07:10 InnoDB: Compressed tables use zlib 1.2.3  
    150610 17:07:10 InnoDB: CPU does not support crc32 instructions  
    150610 17:07:10 InnoDB: Initializing buffer pool, size = 128.0M  
    150610 17:07:10 InnoDB: Completed initialization of buffer pool  
    150610 17:07:10 InnoDB: highest supported file format is Barracuda.  
    InnoDB: Log scan progressed past the checkpoint lsn 48961  
    150610 17:07:10  InnoDB: Database was not shut down normally!  
    InnoDB: Starting crash recovery.  
    InnoDB: Reading tablespace information from the .ibd files...  
    InnoDB: Restoring possible half-written data pages from the doublewrite  
    InnoDB: buffer...  
    InnoDB: Doing recovery: scanned up to log sequence number 1595695  
    150610 17:07:11  InnoDB: Starting an apply batch of log records to the database...  
    InnoDB: Progress in percents: 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99   
    InnoDB: Apply batch completed  
    150610 17:07:11 InnoDB: 128 rollback segment(s) are active.  
    150610 17:07:11 InnoDB: Waiting for the background threads to start  
    150610 17:07:12 InnoDB: 1.2.4 started; log sequence number 1595695  
    150610 17:07:12 [Note] Recovering after a crash using mysql-bin  
    150610 17:07:12 [Note] Starting crash recovery...  
    150610 17:07:12 [Note] Crash recovery finished.  
    150610 17:07:14 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.  
    150610 17:07:14 [Warning] Error while checking replication metadata. Setting the requested repository in order to give users the chance to fix the problem and restart the server. If this is a live upgrade please consider using mysql_upgrade to fix the problem.  
    150610 17:07:14 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.  
    150610 17:07:14 [Warning] Error while checking replication metadata. Setting the requested repository in order to give users the chance to fix the problem and restart the server. If this is a live upgrade please consider using mysql_upgrade to fix the problem.  
    150610 17:07:15 [Note] Binlog end  
    150610 17:07:15 [Note] Shutting down plugin 'partition'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_SYS_TABLES'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_FT_CONFIG'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_FT_DELETED'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_FT_INSERTED'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_METRICS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_CMPMEM'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_CMP_RESET'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_CMP'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_LOCKS'  
    150610 17:07:15 [Note] Shutting down plugin 'INNODB_TRX'  
    150610 17:07:15 [Note] Shutting down plugin 'InnoDB'  
    150610 17:07:15  InnoDB: FTS optimize thread exiting.  
    150610 17:07:15  InnoDB: Starting shutdown...  
    150610 17:07:16 InnoDB: Shutdown completed; log sequence number 1602851  
    150610 17:07:16 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'  
    150610 17:07:16 [Note] Shutting down plugin 'CSV'  
    150610 17:07:16 [Note] Shutting down plugin 'MRG_MYISAM'  
    150610 17:07:16 [Note] Shutting down plugin 'MEMORY'  
    150610 17:07:16 [Note] Shutting down plugin 'MyISAM'  
    150610 17:07:16 [Note] Shutting down plugin 'mysql_old_password'  
    150610 17:07:16 [Note] Shutting down plugin 'mysql_native_password'  
    150610 17:07:16 [Note] Shutting down plugin 'binlog'  
    OK  
    Filling help tables...  
    150610 17:07:16 InnoDB: The InnoDB memory heap is disabled  
    150610 17:07:16 InnoDB: Mutexes and rw_locks use InnoDB's own implementation  
    150610 17:07:16 InnoDB: Compressed tables use zlib 1.2.3  
    150610 17:07:16 InnoDB: CPU does not support crc32 instructions  
    150610 17:07:16 InnoDB: Initializing buffer pool, size = 128.0M  
    150610 17:07:16 InnoDB: Completed initialization of buffer pool  
    150610 17:07:16 InnoDB: highest supported file format is Barracuda.  
    150610 17:07:17 InnoDB: 128 rollback segment(s) are active.  
    150610 17:07:17 InnoDB: 1.2.4 started; log sequence number 1602851  
    150610 17:07:17 [Note] Binlog end  
    150610 17:07:17 [Note] Shutting down plugin 'partition'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_SYS_TABLES'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_FT_CONFIG'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_FT_DELETED'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_FT_INSERTED'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_METRICS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_CMPMEM'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_CMP_RESET'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_CMP'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_LOCKS'  
    150610 17:07:17 [Note] Shutting down plugin 'INNODB_TRX'  
    150610 17:07:17 [Note] Shutting down plugin 'InnoDB'  
    150610 17:07:17  InnoDB: FTS optimize thread exiting.  
    150610 17:07:17  InnoDB: Starting shutdown...  
    150610 17:07:18 InnoDB: Shutdown completed; log sequence number 1602861  
    150610 17:07:18 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'  
    150610 17:07:18 [Note] Shutting down plugin 'CSV'  
    150610 17:07:18 [Note] Shutting down plugin 'MRG_MYISAM'  
    150610 17:07:18 [Note] Shutting down plugin 'MEMORY'  
    150610 17:07:18 [Note] Shutting down plugin 'MyISAM'  
    150610 17:07:18 [Note] Shutting down plugin 'mysql_old_password'  
    150610 17:07:18 [Note] Shutting down plugin 'mysql_native_password'  
    150610 17:07:18 [Note] Shutting down plugin 'binlog'  
    OK  
      
    To start mysqld at boot time you have to copy  
    support-files/mysql.server to the right place for your system  
      
    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !  
    To do so, start the server, then issue the following commands:  
      
    ./bin/mysqladmin -u root password 'new-password'  
    ./bin/mysqladmin -u root -h rh55 password 'new-password'  
      
    Alternatively you can run:  
    ./bin/mysql_secure_installation  
      
    which will also give you the option of removing the test  
    databases and anonymous user created by default.  This is  
    strongly recommended for production servers.  
      
    See the manual for more instructions.  
      
    You can start the MySQL daemon with:  
    cd . ; ./bin/mysqld_safe &  
      
    You can test the MySQL daemon with mysql-test-run.pl  
    cd ./mysql-test ; perl mysql-test-run.pl  
      
    Please report any problems with the ./bin/mysqlbug script!


启动mysql server:

[root@rh55 mysql]# bin/mysqld_safe &
[1] 16199
[root@rh55 mysql]# 150610 17:08:22 mysqld_safe Logging to '/usr/local/mysql/data/mysql/rh55.err'.
150610 17:08:22 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/mysql

验证启动成功:
[root@rh55 mysql]# netstat -an |grep 3306
tcp        0      0 :::3306                     :::*                        LISTEN  


相关专题

更多
交互式图表和动态图表教程汇总
交互式图表和动态图表教程汇总

本专题整合了交互式图表和动态图表的相关内容,阅读专题下面的文章了解更多详细内容。

0

2026.01.13

nginx配置文件详细教程
nginx配置文件详细教程

本专题整合了nginx配置文件相关教程详细汇总,阅读专题下面的文章了解更多详细内容。

1

2026.01.13

nginx部署php项目教程汇总
nginx部署php项目教程汇总

本专题整合了nginx部署php项目教程汇总,阅读专题下面的文章了解更多详细内容。

3

2026.01.13

PHP 表单处理与文件上传安全实战
PHP 表单处理与文件上传安全实战

本专题聚焦 PHP 在表单处理与文件上传场景中的实战与安全问题,系统讲解表单数据获取与校验、XSS 与 CSRF 防护、文件类型与大小限制、上传目录安全配置、恶意文件识别以及常见安全漏洞的防范策略。通过贴近真实业务的案例,帮助学习者掌握 安全、规范地处理用户输入与文件上传的完整开发流程。

7

2026.01.13

PPT交互图表教程大全
PPT交互图表教程大全

本专题整合了PPT交互图表相关教程汇总,阅读专题下面的文章了解更多详细内容。

56

2026.01.12

Java 项目构建与依赖管理(Maven / Gradle)
Java 项目构建与依赖管理(Maven / Gradle)

本专题系统讲解 Java 项目构建与依赖管理的完整体系,重点覆盖 Maven 与 Gradle 的核心概念、项目生命周期、依赖冲突解决、多模块项目管理、构建加速与版本发布规范。通过真实项目结构示例,帮助学习者掌握 从零搭建、维护到发布 Java 工程的标准化流程,提升在实际团队开发中的工程能力与协作效率。

21

2026.01.12

c++主流开发框架汇总
c++主流开发框架汇总

本专题整合了c++开发框架推荐,阅读专题下面的文章了解更多详细内容。

135

2026.01.09

c++框架学习教程汇总
c++框架学习教程汇总

本专题整合了c++框架学习教程汇总,阅读专题下面的文章了解更多详细内容。

66

2026.01.09

学python好用的网站推荐
学python好用的网站推荐

本专题整合了python学习教程汇总,阅读专题下面的文章了解更多详细内容。

140

2026.01.09

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
MySQL 教程
MySQL 教程

共48课时 | 1.7万人学习

MySQL 初学入门(mosh老师)
MySQL 初学入门(mosh老师)

共3课时 | 0.3万人学习

简单聊聊mysql8与网络通信
简单聊聊mysql8与网络通信

共1课时 | 787人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号