参考的教程: 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
执行命令的过程:
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile
(输入这个命令后,光标就卡在这里了)
请问具体的解决方案?
1
neighbads 2018-04-15 18:47:04 +08:00
你不看日志的吗。。。
|
3
defunct9 2018-04-15 18:51:38 +08:00 via iPhone 3
开 ssh,我上去装
|
4
kmdd33 OP / 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) |
5
wwqgtxx 2018-04-15 18:55:54 +08:00
sudo journalctl -u mysqld
|
6
kmdd33 OP 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 |
8
kmdd33 OP |
9
f2f2f 2018-04-15 19:17:45 +08:00
怎么印象里 centos7 并不支持 mysql 5.5 呀……
|
10
LGB 2018-04-15 19:18:34 +08:00 via Android
看错误日志。
|
12
kmdd33 OP |
13
defunct9 2018-04-15 19:48:04 +08:00 via iPhone
猜火车🚄
|
14
kmdd33 OP 输入 sudo journalctl -xe -u mariadb.service
查看信息 然后输入: /usr/bin/mysql_secure_installation 按照提示 输入 enter 然后输入 4 个 y 然后 sudo systemctl status mysqld active 的状态 sudo systemctl start mysqld 成功 谢谢各位 |
15
Beebird 2018-04-15 20:27:53 +08:00
之前卸载的时候,恐怕没有移除 /var/lib/mysql,mariadb-server 和 mysql-server 是默认相同的 db 文件位置。
|
16
zhazi 2018-04-15 20:42:28 +08:00 via Android
我猜是磁盘满了
|
17
venpong 2018-04-15 22:43:32 +08:00 via Android
建议 lnmp 一键安装
|
18
zhjits 2018-04-15 22:54:16 +08:00
MySQL 启动日常
sudo systemctl start mysql --no-block; sudo journalctl -xefu mysql 这样一旦挂了你能知道发生了什么 |
21
keithszc 2018-04-16 08:57:00 +08:00
想问一下,在 centos7 环境下,mariadb 和 mysql 有什么区别吗?
最近我刚好在弄个东西,卸了 mysql 装的 mariadb,一个在官方包里面,一个不在,但是用起来并没有什么区别。 |
22
wizardoz 2018-04-16 14:10:55 +08:00
其实 MySQL 这种应用最适合用 docker 跑了,避开操作系统兼容性问题和多版本共存问题。
|