centos7 安装 mysql 卡住了,输入: sudo systemctl start mysqld 后, 光标停在那里一动不动

2018-04-15 18:30:53 +08:00
 kmdd33

参考的教程: https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7 https://linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7/

环境:cetnos7,openresty,已经安装好了 php7,infophp 也显示正常,之前安装了 mariadb,卸载了,现在安装 mysql5.5

执行命令的过程:

sudo yum install mysql-server

Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile

sudo systemctl start mysqld

(输入这个命令后,光标就卡在这里了)

请问具体的解决方案?

13501 次点击
所在节点    程序员
24 条回复
neighbads
2018-04-15 18:47:04 +08:00
你不看日志的吗。。。
kmdd33
2018-04-15 18:49:38 +08:00
@neighbads 请问日志目录?
defunct9
2018-04-15 18:51:38 +08:00
开 ssh,我上去装
kmdd33
2018-04-15 18:52:55 +08:00
/ var/log/mysqld.log 的日志
@neighbads 不知道你指的是不是这个?



180415 10:39:22 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
180415 10:49:22 mysqld_safe Logging to '/var/log/mysqld.log'.
180415 10:49:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
180415 10:49:22 [Note] /usr/sbin/mysqld (mysqld 5.5.59) starting as process 13415 ...
180415 10:49:22 [Note] Plugin 'FEDERATED' is disabled.
180415 10:49:22 InnoDB: The InnoDB memory heap is disabled
180415 10:49:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180415 10:49:22 InnoDB: Compressed tables use zlib 1.2.3
180415 10:49:22 InnoDB: Using Linux native AIO
180415 10:49:22 InnoDB: Initializing buffer pool, size = 128.0M
180415 10:49:22 InnoDB: Completed initialization of buffer pool
180415 10:49:22 InnoDB: highest supported file format is Barracuda.
180415 10:49:22 InnoDB: Waiting for the background threads to start
180415 10:49:23 InnoDB: 5.5.59 started; log sequence number 1597945
180415 10:49:23 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
180415 10:49:23 [Note] - '0.0.0.0' resolves to '0.0.0.0';
180415 10:49:23 [Note] Server socket created on IP: '0.0.0.0'.
180415 10:49:23 [ERROR] Incorrect definition of table mysql.event: expected column 'sql_mode' at position 14 to have type set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH'), found type set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_A
180415 10:49:23 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
180415 10:49:23 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.59' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
wwqgtxx
2018-04-15 18:55:54 +08:00
sudo journalctl -u mysqld
kmdd33
2018-04-15 18:57:35 +08:00
sudo journalctl -u mysqld
-- Logs begin at Wed 2018-04-11 00:59:13 UTC, end at Sun 2018-04-15 10:56:42 UTC. --
Apr 15 09:58:20 newoneacreland systemd[1]: Starting MySQL Community Server...
Apr 15 09:58:21 newoneacreland mysqld_safe[31839]: 180415 09:58:21 mysqld_safe Logging to '/var/log/mysqld.log'.
Apr 15 09:58:22 newoneacreland mysqld_safe[31839]: 180415 09:58:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Apr 15 10:08:21 newoneacreland systemd[1]: mysqld.service start-post operation timed out. Stopping.
Apr 15 10:08:21 newoneacreland systemd[1]: Failed to start MySQL Community Server.
Apr 15 10:08:21 newoneacreland systemd[1]: Unit mysqld.service entered failed state.
Apr 15 10:08:21 newoneacreland systemd[1]: mysqld.service failed.
Apr 15 10:08:22 newoneacreland systemd[1]: mysqld.service holdoff time over, scheduling restart.
Apr 15 10:08:22 newoneacreland systemd[1]: Starting MySQL Community Server...
Apr 15 10:08:22 newoneacreland mysqld_safe[2173]: 180415 10:08:22 mysqld_safe Logging to '/var/log/mysqld.log'.
Apr 15 10:08:23 newoneacreland mysqld_safe[2173]: 180415 10:08:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Apr 15 10:18:22 newoneacreland systemd[1]: mysqld.service start-post operation timed out. Stopping.
Apr 15 10:18:22 newoneacreland systemd[1]: Failed to start MySQL Community Server.
Apr 15 10:18:22 newoneacreland systemd[1]: Unit mysqld.service entered failed state.
Apr 15 10:18:22 newoneacreland systemd[1]: mysqld.service failed.
Apr 15 10:18:23 newoneacreland systemd[1]: mysqld.service holdoff time over, scheduling restart.
Apr 15 10:18:23 newoneacreland systemd[1]: Starting MySQL Community Server...
Apr 15 10:18:24 newoneacreland mysqld_safe[4906]: 180415 10:18:24 mysqld_safe Logging to '/var/log/mysqld.log'.
Apr 15 10:18:24 newoneacreland mysqld_safe[4906]: 180415 10:18:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Apr 15 10:28:23 newoneacreland systemd[1]: mysqld.service start-post operation timed out. Stopping.
Apr 15 10:28:23 newoneacreland systemd[1]: Failed to start MySQL Community Server.
Apr 15 10:28:23 newoneacreland systemd[1]: Unit mysqld.service entered failed state.
Apr 15 10:28:23 newoneacreland systemd[1]: mysqld.service failed.
Apr 15 10:28:24 newoneacreland systemd[1]: mysqld.service holdoff time over, scheduling restart.
Apr 15 10:28:24 newoneacreland systemd[1]: Starting MySQL Community Server...
Apr 15 10:28:24 newoneacreland mysqld_safe[7562]: 180415 10:28:24 mysqld_safe Logging to '/var/log/mysqld.log'.
Apr 15 10:28:25 newoneacreland mysqld_safe[7562]: 180415 10:28:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
lines 1-28...skipping...
-- Logs begin at Wed 2018-04-11 00:59:13 UTC, end at Sun 2018-04-15 10:56:42 UTC. --
Apr 15 09:58:20 newoneacreland systemd[1]: Starting MySQL Community Server...
Apr 15 09:58:21 newoneacreland mysqld_safe[31839]: 180415 09:58:21 mysqld_safe Logging to '/var/log/mysqld.log'.
Apr 15 09:58:22 newoneacreland mysqld_safe[31839]: 180415 09:58:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Apr 15 10:08:21 newoneacreland systemd[1]: mysqld.service start-post operation timed out. Stopping

@wwqgtxx
kmdd33
2018-04-15 19:00:46 +08:00

截图在这里,麻烦看下,谢谢 @wwqgtxx @neighbads @defunct9
kmdd33
2018-04-15 19:05:47 +08:00


/etc/my.cnf 的配置截图如上




/var/log/mysqld.log 的配置截图如上

@wwqgtxx @neighbads @defunct9
f2f2f
2018-04-15 19:17:45 +08:00
怎么印象里 centos7 并不支持 mysql 5.5 呀……
LGB
2018-04-15 19:18:34 +08:00
看错误日志。
kmdd33
2018-04-15 19:30:46 +08:00
/usr/local/openresty/nginx/logs/error.log



@LGB
kmdd33
2018-04-15 19:31:10 +08:00
defunct9
2018-04-15 19:48:04 +08:00
猜火车🚄
kmdd33
2018-04-15 20:17:48 +08:00
输入 sudo journalctl -xe -u mariadb.service
查看信息
然后输入:
/usr/bin/mysql_secure_installation
按照提示 输入 enter
然后输入 4 个 y
然后 sudo systemctl status mysqld
active 的状态
sudo systemctl start mysqld
成功

谢谢各位
Beebird
2018-04-15 20:27:53 +08:00
之前卸载的时候,恐怕没有移除 /var/lib/mysql,mariadb-server 和 mysql-server 是默认相同的 db 文件位置。
zhazi
2018-04-15 20:42:28 +08:00
我猜是磁盘满了
venpong
2018-04-15 22:43:32 +08:00
建议 lnmp 一键安装
zhjits
2018-04-15 22:54:16 +08:00
MySQL 启动日常
sudo systemctl start mysql --no-block; sudo journalctl -xefu mysql
这样一旦挂了你能知道发生了什么
julyclyde
2018-04-15 22:56:22 +08:00
@venpong 你那种一键安装是最容易出事的,因为你根本不知道它是咋运行的
kmdd33
2018-04-16 02:14:09 +08:00
@zhazi thanks

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/447022

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX