数据库无法启动,mysqld.service: Failed with result 'exit-code'.

问答中心分类: OneinStack数据库无法启动,mysqld.service: Failed with result 'exit-code'.
UioSun asked 6 年 ago

安装完成后,发现 mysql 起不来,换成 MariaDB 后,报错如故。(已根据早上的问题,换成了清华源)
uiosun@uiosun-CW65S:~$ service mysqld status

● mysqld.service - LSB: start and stop MariaDB
Loaded: loaded (/etc/init.d/mysqld; generated)
Active: failed (Result: exit-code) since Fri 2018-07-27 18:45:55 CST; 4min 47s ago
Docs: man:systemd-sysv-generator(8)
Process: 1094 ExecStart=/etc/init.d/mysqld start (code=exited, status=1/FAILURE)
7月 27 18:45:45 uiosun-CW65S systemd[1]: Starting LSB: start and stop MariaDB...
7月 27 18:45:45 uiosun-CW65S mysqld[1094]: Starting MariaDB
7月 27 18:45:48 uiosun-CW65S mysqld[1094]: ...180727 18:45:48 mysqld_safe Logging to '/data/mariadb/mysql-error.log'.
7月 27 18:45:48 uiosun-CW65S mysqld[1094]: 180727 18:45:48 mysqld_safe Starting mysqld daemon with databases from /data/mariadb
7月 27 18:45:55 uiosun-CW65S mysqld[1094]: ...... *
7月 27 18:45:55 uiosun-CW65S systemd[1]: mysqld.service: Control process exited, code=exited status=1
7月 27 18:45:55 uiosun-CW65S systemd[1]: mysqld.service: Failed with result 'exit-code'.
7月 27 18:45:55 uiosun-CW65S systemd[1]: Failed to start LSB: start and stop MariaDB.

 
有一个特别想知道的问题:为什么 sudo oneinstack/addons.sh 这个文件打开,会提示这样的错误呢?
./include/memory.sh: 第 14 行: [: -le: 需要一元表达式
./include/memory.sh: 第 18 行: [:参数太多
是我少安装了什么库吗?

3 Answers
UioSun answered 6 年 ago
错误日志:
2018-07-27 19:05:42 0 [Note] InnoDB: Using Linux native AIO
2018-07-27 19:05:42 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-07-27 19:05:42 0 [Note] InnoDB: Uses event mutexes
2018-07-27 19:05:42 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-07-27 19:05:42 0 [Note] InnoDB: Number of pools: 1
2018-07-27 19:05:42 0 [Note] InnoDB: Using SSE2 crc32 instructions
2018-07-27 19:05:42 0 [Note] InnoDB: Initializing buffer pool, total size = 64M, instances = 1, chunk size = 64M
2018-07-27 19:05:42 0 [Note] InnoDB: Completed initialization of buffer pool
2018-07-27 19:05:42 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-07-27 19:05:42 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=49468
2018-07-27 19:05:42 0 [Note] InnoDB: Starting final batch to recover 13 pages from redo log.
2018-07-27 19:05:42 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2018-07-27 19:05:42 0 [Note] InnoDB: Removed temporary tablespace data file: \"ibtmp1\"
2018-07-27 19:05:42 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-07-27 19:05:42 0 [Note] InnoDB: Setting file \'./ibtmp1\' size to 12 MB. Physically writing the file full; Please wait ...
2018-07-27 19:05:42 0 [Note] InnoDB: File \'./ibtmp1\' size is now 12 MB.
2018-07-27 19:05:42 0 [Note] InnoDB: Waiting for purge to start
2018-07-27 19:05:42 0 [Note] InnoDB: 10.3.8 started; log sequence number 1603183; transaction id 9
2018-07-27 19:05:42 0 [Note] InnoDB: Loading buffer pool(s) from /data/mariadb/ib_buffer_pool
2018-07-27 19:05:42 0 [Note] InnoDB: Cannot open \'/data/mariadb/ib_buffer_pool\' for reading: No such file or directory
2018-07-27 19:05:42 0 [Note] Plugin \'FEEDBACK\' is disabled.
2018-07-27 19:05:42 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2018-07-27 19:05:42 0 [Note] Recovering after a crash using mysql-bin
2018-07-27 19:05:42 0 [Note] Starting crash recovery...
2018-07-27 19:05:42 0 [Note] Crash recovery finished.
2018-07-27 19:05:42 3 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can\'t find file: \'./mysql/\' (errno: 2 \"No such file or directory\")
2018-07-27 19:05:42 0 [ERROR] Can\'t open and lock privilege tables: Table \'mysql.servers\' doesn\'t exist
2018-07-27 19:05:42 0 [Note] Server socket created on IP: \'0.0.0.0\'.
2018-07-27 19:05:42 0 [ERROR] Fatal error: Can\'t open and lock privilege tables: Table \'mysql.user\' doesn\'t exist

oneinstack answered 6 年 ago
这个可能是没有初始化,uninstall.sh 卸载mysql,重装安装下!

UioSun answered 6 年 ago
卸载当前DB,重新安装当前DB或另一版本DB。
按上述进行多次,均无效。
 
已经换回 Windows 了,谢谢大佬,实在苦手