mysql启动错误排查

今天在Redhat7下面安装MySQL,接下来进行启动MySQL

启动结果如下:

[root@localhost log]# service mysqld start 
Redirecting to /bin/systemctl start  mysqld.service

Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details.

那么我们遇到这样的错误就需要找MySQL启动日志,然后进行分析。

MySQL默认的日志路径是:

[root@localhost log]# pwd
/var/log

查看日志内容:

150806 20:57:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2015-08-06 20:57:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-08-06 20:57:06 0 [Note] /usr/sbin/mysqld (mysqld 5.6.26) starting as process 12043 ...
2015-08-06 20:57:06 12043 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2015-08-06 20:57:06 12043 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000)

2015-08-06 20:57:06 12043 [Note] Plugin 'FEDERATED' is disabled.
2015-08-06 20:57:06 12043 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-06 20:57:06 12043 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-06 20:57:06 12043 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-06 20:57:06 12043 [Note] InnoDB: Memory barrier is not used
2015-08-06 20:57:06 12043 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-08-06 20:57:06 12043 [Note] InnoDB: Using Linux native AIO
2015-08-06 20:57:06 12043 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-06 20:57:06 12043 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-06 20:57:06 12043 [Note] InnoDB: Completed initialization of buffer pool
2015-08-06 20:57:06 12043 [Note] InnoDB: Highest supported file format is Barracuda.
2015-08-06 20:57:06 12043 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-06 20:57:06 12043 [Note] InnoDB: Waiting for purge to start
2015-08-06 20:57:06 12043 [Note] InnoDB: 5.6.26 started; log sequence number 1600617
2015-08-06 20:57:06 12043 [ERROR] /usr/sbin/mysqld: unknown option '--rity risks' ##需额外注重ERROR级别的错误信息,此处显示的是未知的参数—rity risks
2015-08-06 20:57:06 12043 [ERROR] Aborting

2015-08-06 20:57:06 12043 [Note] Binlog end
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'partition'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'ARCHIVE'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_METRICS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_CMP'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'INNODB_TRX'
2015-08-06 20:57:06 12043 [Note] Shutting down plugin 'InnoDB'
2015-08-06 20:57:06 12043 [Note] InnoDB: FTS optimize thread exiting.
2015-08-06 20:57:06 12043 [Note] InnoDB: Starting shutdown...
2015-08-06 20:57:08 12043 [Note] InnoDB: Shutdown completed; log sequence number 1600627
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'BLACKHOLE'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'MyISAM'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'MEMORY'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'CSV'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'MRG_MYISAM'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'sha256_password'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'mysql_old_password'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'mysql_native_password'
2015-08-06 20:57:08 12043 [Note] Shutting down plugin 'binlog'
2015-08-06 20:57:08 12043 [Note] /usr/sbin/mysqld: Shutdown complete

150806 20:57:09 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

根据日志信息分析,说是有一个参数错误,那么我们就可以进行参数配置检查

参数信息为:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted secu
rity risks
symbolic-links=0
character-set-server=utf8 #设置字符集为utf8
innodb_file_per_table=1 #让innodb的每个表文件单独存储
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

经检查发现有一个参数rity risk配置有误,由于参数配置直接从网络上拷贝,格式存在问题导致多了一个换行符,将其改为下面这样就好了。

# Disabling symbolic-links is recommended to prevent assorted security risks

转载于:https://www.cnblogs.com/wlzjdm/p/4709524.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值