MySQL Study之--Mysql无法启动“mysql.host”

MySQL Study之--Mysql无法启动“mysql.host”

系统环境:

操作系统:RedHat EL55

DB Soft:  Mysql 5.6.4-m7

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

[[email protected] mysql]# bin/mysqld_safe &

[1] 15846

[[email protected] 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日志:

[[email protected] 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配置文件:

[[email protected] ~]# 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

解决方式:

[[email protected] 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:

[[email protected] mysql]# bin/mysqld_safe &

[1] 16199

[[email protected] 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

验证启动成功:

[[email protected] mysql]# netstat -an |grep 3306

tcp        0      0 :::3306                     :::*                        LISTEN

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

时间: 2024-10-14 09:54:44

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

MySQL Study之--Linux下安装MySQL workbench工具

MySQL Study之--Linux下安装MySQL workbench工具 系统环境:      操作系统: RedHat EL6.4(64)      WorkBench: mysql-workbench-community-6.0.9 MySQL Workbench是一款专为MySQL设计的ER/数据库建模工具.它是著名的数据库设计工具DBDesigner4的继任者.你可以用MySQL Workbench设计和创建新的数据库图示,建立数据库文档,以及进行复杂的MySQL 迁移. MySQ

MySQL Study案例之--快速了解MySQL服务器

MySQL Study案例之--快速了解MySQL服务器 1.查看数据库版本 mysql> show variables like 'version'; +---------------+----------+ | Variable_name | Value    | +---------------+----------+ | version       | 5.6.4-m7 | +---------------+----------+ 1 row in set (0.00 sec) 2.查看

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

1.安装完毕mysql之后,在windows中找到服务,启动MySQL服务(服务端)(mysqld.exe) 2.接下来启动客户端(mysql.exe) 这里参数中: -hlocalhost 表示主机名(绑定主机IP) -P3306表示端口号 -uroot表示用户身份和权限 -p密码

启动MySQL报错

当在linux系统中启动mysql服务的时候service mysqld start时 报:Another MySQL daemon already running with the same unix socket. 解决办法. 原因多个Mysql进程使用了同一个socket. 两个方法解决: 第一个是立即关机 使用命令 shutdown -h now 关机,关机后在启动,进程就停止了. 第二个直接把mysql.sock文件改名即可.也可以删除,推荐改名. 方法 mv /var/lib/mys

无法启动MYSQL服务”1067 进程意外终止”解决办法——汇总及终极方法

自己一开始按照百度经验里的方法--<MySQL下载安装.配置与使用(win7x64)>去安装和配置,但是到后面步骤总是出现1067代号的错误.慢慢折腾去解决. 这里汇总各种导致mysql提示无法启动MYSQL服务"1067 进程意外终止"的一些解决办法.自己遇到这个问题是查了很多方法不行,最后看到一个论坛的讨论,试了一下竟然可以.一下是网上的部分方法,最后可以的那个方法我放在最后面: 启用MySql服务的时候出现"windows无法启动mysql服务(位于本地计算

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

原文:http://www.111cn.net/database/mysql/48888.htm 本文章主要是总结了各种导致mysql提示无法启动MYSQL服务"1067 进程意外终止"的一些解决办法,有碰到mysql无法启动的同学可尝试参考. 启用MySql服务的时候出现"windows无法启动mysql服务(位于本地计算机上.错误1067:进程意外终止)",看看mysql服务并没有其它的依赖安系啊,于是突然想到进系统日志看看,果然发现很多MySql的很多错误,终

无法启动MYSQL服务”1067 进程意外终止”解决的方法——汇总及终极方法

自己一開始依照百度经验里的方法--<MySQL下载安装.配置与使用(win7x64)>去安装和配置,可是到后面步骤总是出现1067代号的错误. 慢慢折腾去解决. 这里汇总各种导致mysql提示无法启动MYSQL服务"1067 进程意外终止"的一些解决的方法.自己遇到这个问题是查了非常多方法不行,最后看到一个论坛的讨论.试了一下居然能够.一下是网上的部分方法.最后能够的那个方法我放在最后面: 启用MySql服务的时候出现"windows无法启动mysql服务(位于本

在Mac如何启动MySQL

安装好MySQL服务后(安装步骤可以参考系列经验1).打开"系统偏好设置",单击下端的"MySQL"图标. 2 在"MySQL"对话框中,单击"启动MySQL服务"按钮. 3 在弹出的窗口中,输入管理员密码,然后单击"好"按钮. 4 在"MySQL"对话框中,MySQL服务的状态显示为:如下状态表示MySQL服务已经启动. END 使用终端登录MySQL: 在Finder的侧边栏中单击&

mysql 执行 cannot found mac安装mysql的两种方法(含配置)

mac安装mysql的两种方法(含配置 此时我们在命令行输入mysql -uroot -p命令会提示没有commod not found,我们还需要将mysql加入系统环境变量. (1).进入/usr/local/mysql/bin,查看此目录下是否有mysql,见pic6. (2).执行vim ~/.bash_profile 在该文件中添加mysql/bin的目录,见pic7: PATH=$PATH:/usr/local/mysql/bin 添加完成后,按esc,然后输入wq保存. 最后在命令

MySQL数据库基础(一)——MySQL数据库简介

MySQL数据库基础(一)--MySQL数据库简介 一.MySQL简介 1.MySQL简介 MySQL是一个轻量级关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司.目前MySQL被广泛地应用在Internet上的中小型网站中,由于体积小.速度快.总体拥有成本低,开放源码.免费,一般中小型网站的开发都选择Linux + MySQL作为网站数据库.MySQL是一个关系型数据库管理系统,MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据