淘小欣
2021-05-18 19:16
采纳率: 100%
浏览 107

mysql启动失败报错:ob for mysqld.service failed

本文主要遇到的问题,启动mysql报错:Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

[root@oldboy ~]# service mysqld start     # 重启
    Redirecting to /bin/systemctl restart mysqld.service
    Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

百度了好久,经过一系列的重启,修改权限,并不能精准找到错误原因,发现有说磁盘空间不足的、有说需要删除var/lib/mysql,所有文章千篇一律。

然而,无论哪种说法,都没有什么卵用

查看mysql日志:cat /var/log/mysqld.log

 

提示3306端口被占用了,但是过滤并没有mysql相关进程

[root@oldboy ~]# ps aux | grep mysql
root     25791  0.0  0.0 112812   972 pts/2    R+   18:29   0:00 grep --color=auto mysql

修改配置文件后,依旧重启报错

[root@oldboy etc]# systemctl restart mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@oldboy etc]# systemctl restart mysql
Failed to restart mysql.service: Unit not found.

烦请路过的大佬帮忙看看,感谢万分!!!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • shitou_12 2021-05-18 19:23
    已采纳

    检查下端口是否被占用;

    最好还是把报错日志发下

    ss -antlp|grep 3306
    点赞 1 评论
  • 淘小欣 2021-05-18 19:41
    2021-05-17T16:36:40.366791Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2021-05-17T16:36:41.710238Z 0 [Warning] InnoDB: New log files created, LSN=45790
    2021-05-17T16:36:41.930452Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
    2021-05-17T16:36:42.077518Z 0 [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: 0f771bfe-b72e-11eb-aefc-fa2020091788.
    2021-05-17T16:36:42.110669Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
    2021-05-17T16:36:47.225119Z 0 [Warning] CA certificate ca.pem is self signed.
    2021-05-17T16:36:48.089508Z 1 [Note] A temporary password is generated for root@localhost: Pia.k6gL%jz1
    2021-05-17T16:37:00.207409Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2021-05-17T16:37:00.216299Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.34) starting as process 373 ...
    2021-05-17T16:37:00.227794Z 0 [Note] InnoDB: PUNCH HOLE support available
    2021-05-17T16:37:00.227850Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2021-05-17T16:37:00.227858Z 0 [Note] InnoDB: Uses event mutexes
    2021-05-17T16:37:00.227864Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    2021-05-17T16:37:00.227871Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
    2021-05-17T16:37:00.227880Z 0 [Note] InnoDB: Using Linux native AIO
    2021-05-17T16:37:00.228418Z 0 [Note] InnoDB: Number of pools: 1
    2021-05-17T16:37:00.228606Z 0 [Note] InnoDB: Using CPU crc32 instructions
    2021-05-17T16:37:00.231251Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
    2021-05-17T16:37:00.257897Z 0 [Note] InnoDB: Completed initialization of buffer pool
    2021-05-17T16:37:00.420407Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2021-05-17T16:37:00.424076Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
    2021-05-17T16:37:00.509713Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2021-05-17T16:37:00.509825Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
    2021-05-17T16:37:00.651025Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
    2021-05-17T16:37:00.652730Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2021-05-17T16:37:00.652761Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    2021-05-17T16:37:00.653186Z 0 [Note] InnoDB: Waiting for purge to start
    2021-05-17T16:37:00.706180Z 0 [Note] InnoDB: 5.7.34 started; log sequence number 2747975
    2021-05-17T16:37:00.718291Z 0 [Note] Plugin 'FEDERATED' is disabled.
    2021-05-17T16:37:00.725405Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
    2021-05-17T16:37:00.728065Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210518  0:37:00
    2021-05-17T16:37:00.756460Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
    2021-05-17T16:37:00.756500Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
    2021-05-17T16:37:00.757727Z 0 [Warning] CA certificate ca.pem is self signed.
    2021-05-17T16:37:00.757812Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
    2021-05-17T16:37:00.806144Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
    2021-05-17T16:37:00.806280Z 0 [Note] IPv6 is available.
    2021-05-17T16:37:00.806304Z 0 [Note]   - '::' resolves to '::';
    2021-05-17T16:37:00.806344Z 0 [Note] Server socket created on IP: '::'.
    2021-05-17T16:37:00.806387Z 0 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
    2021-05-17T16:37:00.806393Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
    2021-05-17T16:37:00.806427Z 0 [ERROR] Aborting
    
    2021-05-17T16:37:00.806471Z 0 [Note] Binlog end
    2021-05-17T16:37:00.806595Z 0 [Note] Shutting down plugin 'validate_password'
    2021-05-17T16:37:00.806625Z 0 [Note] Shutting down plugin 'ngram'
    2021-05-17T16:37:00.806629Z 0 [Note] Shutting down plugin 'partition'
    2021-05-17T16:37:00.806660Z 0 [Note] Shutting down plugin 'BLACKHOLE'
    2021-05-17T16:37:00.806677Z 0 [Note] Shutting down plugin 'ARCHIVE'
    2021-05-17T16:37:00.806681Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
    2021-05-17T16:37:00.806776Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
    2021-05-17T16:37:00.806783Z 0 [Note] Shutting down plugin 'MyISAM'
    2021-05-17T16:37:00.806801Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
    2021-05-17T16:37:00.806807Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
    2021-05-17T16:37:00.806811Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
    2021-05-17T16:37:00.806815Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    2021-05-17T16:37:00.806819Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    2021-05-17T16:37:00.806823Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    2021-05-17T16:37:00.806827Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    2021-05-17T16:37:00.806831Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    2021-05-17T16:37:00.806835Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    2021-05-17T16:37:00.806839Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    2021-05-17T16:37:00.806843Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    2021-05-17T16:37:00.806847Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    2021-05-17T16:37:00.806852Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    2021-05-17T16:37:00.806856Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    2021-05-17T16:37:00.806860Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    2021-05-17T16:37:00.806864Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    2021-05-17T16:37:00.806868Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
    2021-05-17T16:37:00.806872Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
    2021-05-17T16:37:00.806876Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    2021-05-17T16:37:00.806880Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    2021-05-17T16:37:00.806884Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    2021-05-17T16:37:00.806888Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
    2021-05-17T16:37:00.806892Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
    2021-05-17T16:37:00.806896Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    2021-05-17T16:37:00.806900Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
    2021-05-17T16:37:00.806903Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    2021-05-17T16:37:00.806907Z 0 [Note] Shutting down plugin 'INNODB_CMP'
    2021-05-17T16:37:00.806911Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    2021-05-17T16:37:00.806915Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
    2021-05-17T16:37:00.806919Z 0 [Note] Shutting down plugin 'INNODB_TRX'
    2021-05-17T16:37:00.806923Z 0 [Note] Shutting down plugin 'InnoDB'
    2021-05-17T16:37:00.808225Z 0 [Note] InnoDB: FTS optimize thread exiting.
    2021-05-17T16:37:00.809276Z 0 [Note] InnoDB: Starting shutdown...
    2021-05-17T16:37:00.917368Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
    2021-05-17T16:37:00.917680Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 210518  0:37:00
    2021-05-17T16:37:02.625388Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2747994
    2021-05-17T16:37:02.626080Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    2021-05-17T16:37:02.626110Z 0 [Note] Shutting down plugin 'MEMORY'
    2021-05-17T16:37:02.626123Z 0 [Note] Shutting down plugin 'CSV'
    2021-05-17T16:37:02.626131Z 0 [Note] Shutting down plugin 'sha256_password'
    2021-05-17T16:37:02.626135Z 0 [Note] Shutting down plugin 'mysql_native_password'
    2021-05-17T16:37:02.626456Z 0 [Note] Shutting down plugin 'binlog'
    2021-05-17T16:37:02.626922Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
    
    2021-05-17T16:37:15.088046Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2021-05-17T16:37:15.090977Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.34) starting as process 867 ...
    2021-05-17T16:37:15.129254Z 0 [Note] InnoDB: PUNCH HOLE support available
    2021-05-17T16:37:15.129317Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2021-05-17T16:37:15.129324Z 0 [Note] InnoDB: Uses event mutexes
    2021-05-17T16:37:15.129330Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    2021-05-17T16:37:15.129336Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
    2021-05-17T16:37:15.129342Z 0 [Note] InnoDB: Using Linux native AIO
    2021-05-17T16:37:15.129813Z 0 [Note] InnoDB: Number of pools: 1
    2021-05-17T16:37:15.130014Z 0 [Note] InnoDB: Using CPU crc32 instructions
    2021-05-17T16:37:15.132442Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
    2021-05-17T16:37:15.165348Z 0 [Note] InnoDB: Completed initialization of buffer pool
    2021-05-17T16:37:15.222515Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2021-05-17T16:37:15.243851Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
    2021-05-17T16:37:15.296902Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2021-05-17T16:37:15.297054Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
    2021-05-17T16:37:15.505998Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
    2021-05-17T16:37:15.507758Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2021-05-17T16:37:15.507791Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    2021-05-17T16:37:15.508216Z 0 [Note] InnoDB: Waiting for purge to start
    2021-05-17T16:37:15.569167Z 0 [Note] InnoDB: 5.7.34 started; log sequence number 2747994
    2021-05-17T16:37:15.569836Z 0 [Note] Plugin 'FEDERATED' is disabled.
    2021-05-17T16:37:15.577328Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
    2021-05-17T16:37:15.579706Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210518  0:37:15
    2021-05-17T16:37:15.594268Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
    2021-05-17T16:37:15.594318Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
    2021-05-17T16:37:15.595658Z 0 [Warning] CA certificate ca.pem is self signed.
    2021-05-17T16:37:15.595747Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
    2021-05-17T16:37:15.614980Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
    2021-05-17T16:37:15.615122Z 0 [Note] IPv6 is available.
    2021-05-17T16:37:15.615153Z 0 [Note]   - '::' resolves to '::';
    2021-05-17T16:37:15.615193Z 0 [Note] Server socket created on IP: '::'.
    2021-05-17T16:37:15.747991Z 0 [Note] Event Scheduler: Loaded 0 events
    2021-05-17T16:37:15.748652Z 0 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.7.34'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
    2021-05-17T16:39:31.012017Z 2 [Note] Access denied for user 'root'@'localhost' (using password: YES)
    2021-05-18T00:17:01.263360Z 0 [Note] Giving 0 client threads a chance to die gracefully
    2021-05-18T00:17:01.266928Z 0 [Note] Shutting down slave threads
    2021-05-18T00:17:01.268211Z 0 [Note] Forcefully disconnecting 0 remaining clients
    2021-05-18T00:17:01.269191Z 0 [Note] Event Scheduler: Purging the queue. 0 events
    2021-05-18T00:17:01.274366Z 0 [Note] Binlog end
    2021-05-18T00:17:01.327196Z 0 [Note] Shutting down plugin 'validate_password'
    2021-05-18T00:17:01.327256Z 0 [Note] Shutting down plugin 'ngram'
    2021-05-18T00:17:01.327261Z 0 [Note] Shutting down plugin 'partition'
    2021-05-18T00:17:01.327265Z 0 [Note] Shutting down plugin 'BLACKHOLE'
    2021-05-18T00:17:01.330598Z 0 [Note] Shutting down plugin 'ARCHIVE'
    2021-05-18T00:17:01.330641Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
    2021-05-18T00:17:01.330710Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
    2021-05-18T00:17:01.330723Z 0 [Note] Shutting down plugin 'MyISAM'
    2021-05-18T00:17:01.331328Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
    2021-05-18T00:17:01.331344Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
    2021-05-18T00:17:01.331347Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
    2021-05-18T00:17:01.331349Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    2021-05-18T00:17:01.331352Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    2021-05-18T00:17:01.331354Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    2021-05-18T00:17:01.331357Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    2021-05-18T00:17:01.331359Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    2021-05-18T00:17:01.331362Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    2021-05-18T00:17:01.331364Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    2021-05-18T00:17:01.331367Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    2021-05-18T00:17:01.331369Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    2021-05-18T00:17:01.331372Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    2021-05-18T00:17:01.331375Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    2021-05-18T00:17:01.331377Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    2021-05-18T00:17:01.331380Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    2021-05-18T00:17:01.331382Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
    2021-05-18T00:17:01.331385Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
    2021-05-18T00:17:01.331387Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    2021-05-18T00:17:01.331390Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    2021-05-18T00:17:01.331392Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    2021-05-18T00:17:01.331395Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
    2021-05-18T00:17:01.331397Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
    2021-05-18T00:17:01.331400Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    2021-05-18T00:17:01.331402Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
    2021-05-18T00:17:01.331405Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    2021-05-18T00:17:01.331407Z 0 [Note] Shutting down plugin 'INNODB_CMP'
    2021-05-18T00:17:01.331410Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    2021-05-18T00:17:01.331412Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
    2021-05-18T00:17:01.331415Z 0 [Note] Shutting down plugin 'INNODB_TRX'
    2021-05-18T00:17:01.331417Z 0 [Note] Shutting down plugin 'InnoDB'
    2021-05-18T00:17:01.379030Z 0 [Note] InnoDB: FTS optimize thread exiting.
    2021-05-18T00:17:01.379370Z 0 [Note] InnoDB: Starting shutdown...
    2021-05-18T00:17:01.480714Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
    2021-05-18T00:17:01.481009Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 210518  8:17:01
    2021-05-18T00:17:02.566742Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2748022
    2021-05-18T00:17:02.578126Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    2021-05-18T00:17:02.578188Z 0 [Note] Shutting down plugin 'MEMORY'
    2021-05-18T00:17:02.578200Z 0 [Note] Shutting down plugin 'CSV'
    2021-05-18T00:17:02.578205Z 0 [Note] Shutting down plugin 'sha256_password'
    2021-05-18T00:17:02.578209Z 0 [Note] Shutting down plugin 'mysql_native_password'
    2021-05-18T00:17:02.645949Z 0 [Note] Shutting down plugin 'binlog'
    2021-05-18T00:17:02.700082Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
    
    
    点赞 评论
  • 有问必答小助手 2021-05-19 11:09

    您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

    如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

    ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632

    点赞 评论

相关推荐 更多相似问题