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

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

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  




版权声明:本文博主原创文章。博客,未经同意不得转载。

MySQL Study之--Mysql无法启动“mysql.host”的更多相关文章

  1. MySQL(1):启动MySQL服务,客户端连接服务

    1.安装完毕mysql之后,在windows中找到服务,启动MySQL服务(服务端)(mysqld.exe) 2.接下来启动客户端(mysql.exe) 这里参数中: -hlocalhost 表示主机 ...

  2. [mysql,2018-02-28] bat安装、启动mysql,并创建数据库、表

    @echo off f: cd F:\mysql-win32 @echo off&setlocal enabledelayedexpansion cd bin echo ###### 停止当前 ...

  3. mysql安装过程及无法启动mysql的办法

    下载并解压MySQL 下载mysql-8.0.17-win64 \https://dev.mysql.com/downloads/mysql/8.0.html        // 这里提供的是8.0以 ...

  4. centos7 启动mysql

    密码无法登录问题: 在my.cnf  中加一句   skip-grant-tables : 重启mysql服务: mysql -uroot -p: USE mysql ; 进入后,修改密码 .UPDA ...

  5. windows下如何安装和启动MySQL

    1.下载,解压到自己喜欢的目录 2.配置环境变量.MYSQL_HOME,值为mysql的根目录:在path中添加%MYSQL_HOME%/bin目录. 3.向windows注册mysql服务.必须用管 ...

  6. 无法启动MYSQL服务”1067 进程意外终止”解决办法

    原文:http://www.111cn.net/database/mysql/48888.htm   本文章主要是总结了各种导致mysql提示无法启动MYSQL服务"1067 进程意外终止& ...

  7. 无法启动mysql服务”1067 进程意外终止”解决办法【简记】

    本文章主要是总结了各种导致mysql提示无法启动MYSQL服务”1067 进程意外终止”的一些解决办法,有碰到mysql无法启动的同学可尝试参考. 在win7的服务器里开启MySql服务提示“wind ...

  8. 移走mysql data目录,及常见mysql启动问题

    一般mysql安装在/usr/local/下,现以将/usr/local/mysql/data目录移动到/home/mysql下为例 首先保证/home/mysql目录是存在的,本例中使用了mysql ...

  9. docker 启动MySQL

    Docker启动mysql的坑2   正确启动mysql: docker run -p 3306:3306 --name mysql02 -e MYSQL_ROOT_PASSWORD=123456 - ...

  10. 启动Mysql数据库报错误:-bash: ./start.sh: Permission denied

    linux下安装好Mysql数据库后,输入启动命令: cd /home/homework/mysql && ./start.sh 回车后报如下错误: 原因是:该文件未有相关执行权限 解 ...

随机推荐

  1. 用数据说话,外贸产品选择(中篇)-google趋势分析法

    在上篇文章<用数据说话,贸B2C产品选择(上篇)-热门搜索法>中我们能搜索出来几种产品了,那我们就拿上次搜索出来的热门产品来做一个趋势分析.我们经过几个站点挑出了几种热卖产品Wedding ...

  2. 一个简单的带缓存http代理

    眼下1.0版模型非常easy.即对客户机发来的请求进行简单处理后,转发到server.转发之前先检查本地缓存.假设有.则直接回送给客户本地资源 程序流程大致例如以下图: 缓存是通过把文件保存到磁盘上, ...

  3. Android 高仿微信即时聊天 百度云为基础的推

    转载请注明出处:http://blog.csdn.net/lmj623565791/article/details/38799363 ,本文出自:[张鸿洋的博客] 一直在仿微信界面,今天最终有幸利用百 ...

  4. 安卓的sqlite增删改

    基于安卓的sqlite增删改,笔记学习: 1.使用LinearLayout 布局生成,增删改的页面如图 代码布局如下: <LinearLayout xmlns:android="htt ...

  5. http与https与socket tcp/IP与UDP 协议等

    网络由下往上分为:   物理层--                       数据链路层-- 网络层--                       IP协议 传输层--               ...

  6. Phone Number 2010年山东省第一届ACM大学生程序设计竞赛

    Phone Number Time Limit: 1000MS Memory limit: 65536K 题目描述 We know that if a phone number A is anothe ...

  7. 【C语言探索之旅】 第二部分第十课:练习题和习作

    内容简介 1.课程大纲 2.第二部分第十一课:  练习题和习作 3.第三部分第一课预告:  安装SDL 课程大纲 我们的课程分为四大部分,每一个部分结束后都会有练习题,并会公布答案.还会带大家用C语言 ...

  8. Everything中文绿色版在Win7/8/10用不了问题的图文教程,只显示盘符

    打开Everything后点击菜单上的“工具”——“选项” 勾选 Everything Service 后,点应用 需要用到管理者权限

  9. Lua中的weak表——weak table(转)

    弱表(weak table)是一个很有意思的东西,像C++/Java等语言是没有的.弱表的定义是:A weak table is a table whose elements are weak ref ...

  10. Lua中的require(转)

    lua中的require机制    为了方便代码管理,通常会把lua代码分成不同的模块,然后在通过require函数把它们加载进来.现在看看lua的require的处理流程.1.require机制相关 ...