VPS侦探论坛

 找回密码
 注册
查看: 2434|回复: 9

mariadb 无法启动

[复制链接]
发表于 2020-3-19 16:38:12 | 显示全部楼层 |阅读模式

重装重启都不行
mariadb.err日志
2020-03-19 16:00:38 0 [Note] InnoDB: Using Linux native AIO
2020-03-19 16:00:38 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-03-19 16:00:38 0 [Note] InnoDB: Uses event mutexes
2020-03-19 16:00:38 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-03-19 16:00:38 0 [Note] InnoDB: Number of pools: 1
2020-03-19 16:00:38 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-03-19 16:00:38 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2020-03-19 16:00:38 0 [Note] InnoDB: Completed initialization of buffer pool
2020-03-19 16:00:38 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-03-19 16:00:38 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=49468
2020-03-19 16:00:38 0 [Note] InnoDB: Starting final batch to recover 13 pages from redo log.
2020-03-19 16:00:39 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-03-19 16:00:39 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-03-19 16:00:39 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-03-19 16:00:39 0 [Note] InnoDB: Setting file '/usr/local/mariadb2/var/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-03-19 16:00:39 0 [Note] InnoDB: File '/usr/local/mariadb2/var/ibtmp1' size is now 12 MB.
2020-03-19 16:00:39 0 [Note] InnoDB: Waiting for purge to start
2020-03-19 16:00:39 0 [Note] InnoDB: 10.3.15 started; log sequence number 1603190; transaction id 9
2020-03-19 16:00:39 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mariadb2/var/ib_buffer_pool
2020-03-19 16:00:39 0 [Note] InnoDB: Cannot open '/usr/local/mariadb2/var/ib_buffer_pool' for reading: No such file or directory
2020-03-19 16:00:39 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-03-19 16:00:39 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2020-03-19 16:00:39 0 [Note] Recovering after a crash using mysql-bin
2020-03-19 16:00:39 0 [Note] Starting crash recovery...
2020-03-19 16:00:39 0 [Note] Crash recovery finished.
2020-03-19 16:00:39 6 [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")
2020-03-19 16:00:39 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2020-03-19 16:00:39 0 [Note] Server socket created on IP: '::'.
2020-03-19 16:00:39 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist



美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2020-3-20 13:47:05 | 显示全部楼层


2020-03-20 12:05:44 0 [ERROR] mysqld: Can't create/write to file '/tmp/user/0/ib4c9WbZ' (Errcode: 13 "Permission denied")
2020-03-20 12:05:44 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2020-03-20 12:05:44 0 [ERROR] mysqld: Can't create/write to file '/tmp/user/0/ibKQBbng' (Errcode: 13 "Permission denied")
2020-03-20 12:05:44 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2020-03-20 12:05:44 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2020-03-20 12:05:44 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-03-20 12:05:44 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-03-20 12:05:44 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-03-20 12:05:44 0 [ERROR] Aborting

你系统的/tmp 目录权限有问题,无法正常写入临时文件导致的
ls -l / 看一下 /tmp权限,不是777的话chmod 777 -R /tmp
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-3-19 16:41:26 | 显示全部楼层

之前把安装路径改到mariadb2
Download_Mirror='https://soft.vpser.net'

Nginx_Modules_Options=''
PHP_Modules_Options=''

##MySQL/MariaDB database directory##
MySQL_Data_Dir='/usr/local/mysql2/var'
MariaDB_Data_Dir='/usr/local/mariadb2/var'
##Default website home directory##
Default_Website_Dir='/home/wwwroot/default'

Enable_Nginx_Openssl='y'
Enable_PHP_Fileinfo='n'
Enable_Nginx_Lua='n'
Enable_Swap='y'
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2020-3-19 19:25:39 | 显示全部楼层



看mariadb日志信息,连数据库表都不存在应该是安装过程中就出错了,上传一下lnmp安装日志
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-3-19 23:07:48 | 显示全部楼层

日志压缩后还是太大了 我找了找发现这步不对...
-- Installing: /usr/local/mariadb/share/pkgconfig/mariadb.pc
-- Installing: /usr/local/mariadb/share/aclocal/mysql.m4
-- Installing: /usr/local/mariadb/support-files/mysql.server
groupadd:“mariadb”组已存在
useradd:用户“mariadb”已存在
Installing MariaDB/MySQL system tables in '/usr/local/mariadb2/var' ...

Installation of system tables failed!  Examine the logs in
/usr/local/mariadb2/var for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/local/mariadb/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/local/mariadb/bin/mysqld --skip-grant-tables --general-log &

and use the command line tool /usr/local/mariadb/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/local/mariadb/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /usr/local/mariadb2/var that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

mariadb.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mariadb
Add mariadb service at system startup...
Starting mariadb (via systemctl): mariadb.serviceJob for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
failed!
Restarting mariadb (via systemctl): mariadb.serviceJob for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
failed!
/usr/local/mariadb/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
failed, try other way...
Restarting mariadb (via systemctl): mariadb.serviceJob for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
failed!
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Set password failed!
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
FLUSH PRIVILEGES failed!
Restarting mariadb (via systemctl): mariadb.serviceJob for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
failed!
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Update root password...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Remove anonymous users...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Disallow root login remotely...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Remove test database...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Reload privilege tables...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Restarting mariadb (via systemctl): mariadb.serviceJob for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
failed!
Stopping mariadb (via systemctl): mariadb.service.
Clean database src directory...


军哥运维代购:http://shop63846532.taobao.com/

发表于 2020-3-20 08:59:27 | 显示全部楼层

mover_kpr 发表于 2020-3-19 23:07
日志压缩后还是太大了 我找了找发现这步不对...
-- Installing: /usr/local/mariadb/share/pkgconfig/maria ...

不清楚原因,需要发一下安装时间的mariadb日志和 systemctl status mariadb.service 、 journalctl -xe 这两个的返回信息
再看一下硬盘空间使用情况
 楼主| 发表于 2020-3-20 09:51:30 | 显示全部楼层

root@localhost:~# systemctl status mariadb.service
● mariadb.service - LSB: start and stop MariaDB
   Loaded: loaded (/etc/init.d/mariadb; generated)
   Active: failed (Result: exit-code) since Fri 2020-03-20 09:34:43 CST; 2min 21s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 571 ExecStart=/etc/init.d/mariadb start (code=exited, status=1/FAILURE)

3月 20 09:34:27 localhost systemd[1]: Starting LSB: start and stop MariaDB...
3月 20 09:34:30 localhost mariadb[571]: Starting MariaDB
3月 20 09:34:32 localhost mariadb[571]: .200320 09:34:32 mysqld_safe Logging to '/usr/local/mariadb/data/
3月 20 09:34:32 localhost mariadb[571]: 200320 09:34:32 mysqld_safe Starting mysqld daemon with databases
3月 20 09:34:43 localhost mariadb[571]: ........../etc/init.d/mariadb: 264: kill: No such process
3月 20 09:34:43 localhost mariadb[571]:  failed!
3月 20 09:34:43 localhost systemd[1]: mariadb.service: Control process exited, code=exited, status=1/FAIL
3月 20 09:34:43 localhost systemd[1]: mariadb.service: Failed with result 'exit-code'.
3月 20 09:34:43 localhost systemd[1]: Failed to start LSB: start and stop MariaDB.
----------------------------------------------------------------------------------------------------------------------------------------------
root@localhost:~#  journalctl -xe
3月 20 09:36:50 localhost systemd[1577]: Startup finished in 418ms.
-- Subject: User manager start-up is now complete
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The user manager instance for user 0 has been started. All services queued
-- for starting have been started. Note that other services might still be starting
-- up or be started at any later time.
--
-- Startup of the manager took 418555 microseconds.
3月 20 09:36:50 localhost systemd[1]: Started User Manager for UID 0.
-- Subject: user@0.service 单元已结束启动
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- user@0.service 单元已结束启动。
--
-- 启动结果为“done”。
3月 20 09:36:50 localhost systemd[1]: Started Session 3 of user root.
-- Subject: session-3.scope 单元已结束启动
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- session-3.scope 单元已结束启动。
--
-- 启动结果为“done”。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2020-3-20 09:56:35 | 显示全部楼层

文件系统        容量  已用  可用 已用% 挂载点
udev            1.9G     0  1.9G    0% /dev
tmpfs           383M  5.5M  377M    2% /run
/dev/sdb3        55G   13G   40G   25% /
tmpfs           1.9G     0  1.9G    0% /dev/shm
tmpfs           5.0M     0  5.0M    0% /run/lock
tmpfs           1.9G     0  1.9G    0% /sys/fs/cgroup
tmpfs           383M     0  383M    0% /run/user/0
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-3-20 12:51:10 | 显示全部楼层

我在新盘里装了个系统,安装lnmp成功后运行mariadb报错
root@localhost:~/lnmp1.6# systemctl status mariadb.service
● mariadb.service - LSB: start and stop MariaDB
   Loaded: loaded (/etc/init.d/mariadb; generated)
   Active: failed (Result: exit-code) since Fri 2020-03-20 12:18:13 CST; 30min ago
     Docs: man:systemd-sysv-generator(8)

3月 20 12:18:12 localhost systemd[1]: Starting LSB: start and stop MariaDB...
3月 20 12:18:12 localhost mariadb[3944]: Starting MariaDB
3月 20 12:18:12 localhost mariadb[3944]: .200320 12:18:12 mysqld_safe Logging to '/usr/local/mariadb/var/
3月 20 12:18:12 localhost mariadb[3944]: 200320 12:18:12 mysqld_safe Starting mysqld daemon with database
3月 20 12:18:13 localhost mariadb[3944]: /etc/init.d/mariadb: 264: kill: No such process
3月 20 12:18:13 localhost mariadb[3944]:  failed!
3月 20 12:18:13 localhost systemd[1]: mariadb.service: Control process exited, code=exited, status=1/FAIL
3月 20 12:18:13 localhost systemd[1]: mariadb.service: Failed with result 'exit-code'.
3月 20 12:18:13 localhost systemd[1]: Failed to start LSB: start and stop MariaDB.

其他安装日志 mariadb.err journalctl -xe结果传到网盘了
https://send.firefox.com/download/8ce27f80ef2a9fc8/#ODYjKpMW4s7EW4co6V9K9w

磁盘使用情况
root@localhost:~/lnmp1.6# df -h
文件系统        容量  已用  可用 已用% 挂载点
udev            1.9G     0  1.9G    0% /dev
tmpfs           383M  5.5M  377M    2% /run
/dev/sda2        64G  5.8G   55G   10% /
tmpfs           1.9G     0  1.9G    0% /dev/shm
tmpfs           5.0M     0  5.0M    0% /run/lock
tmpfs           1.9G     0  1.9G    0% /sys/fs/cgroup
/dev/sda1       922M   60M  799M    7% /boot
tmpfs           383M     0  383M    0% /run/user/0

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2020-3-21 09:29:51 | 显示全部楼层



!!!感谢!!!!
之前权限
drwxrwxrwt  11 root root  4096 3月  20 13:54 tmp
777后
drwxrwxrwx  11 root root  4096 3月  20 13:54 tmp
重启mariadb服务还是报错
卸载lnmp重新安装后mariadb服务可以正常启动了

可我在腾讯云服务器上部署时 /tmp权限是drwxrwxrwt却没有出现任何问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 12:58 , Processed in 0.029637 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表