mover_kpr 发表于 2020-3-19 16:38:12

mariadb 无法启动

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



licess 发表于 2020-3-20 13:47:05

2020-03-20 12:05:44 0 mysqld: Can't create/write to file '/tmp/user/0/ib4c9WbZ' (Errcode: 13 "Permission denied")
2020-03-20 12:05:44 0 InnoDB: Unable to create temporary file; errno: 13
2020-03-20 12:05:44 0 mysqld: Can't create/write to file '/tmp/user/0/ibKQBbng' (Errcode: 13 "Permission denied")
2020-03-20 12:05:44 0 InnoDB: Unable to create temporary file; errno: 13
2020-03-20 12:05:44 0 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 Plugin 'InnoDB' init function returned error.
2020-03-20 12:05:44 0 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-03-20 12:05:44 0 Unknown/unsupported storage engine: InnoDB
2020-03-20 12:05:44 0 Aborting
你系统的/tmp 目录权限有问题,无法正常写入临时文件导致的
ls -l / 看一下 /tmp权限,不是777的话chmod 777 -R /tmp

mover_kpr 发表于 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'

licess 发表于 2020-3-19 19:25:39

看mariadb日志信息,连数据库表都不存在应该是安装过程中就出错了,上传一下lnmp安装日志

mover_kpr 发表于 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...


licess 发表于 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 这两个的返回信息
再看一下硬盘空间使用情况

mover_kpr 发表于 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: Starting LSB: start and stop MariaDB...
3月 20 09:34:30 localhost mariadb: Starting MariaDB
3月 20 09:34:32 localhost mariadb: .200320 09:34:32 mysqld_safe Logging to '/usr/local/mariadb/data/
3月 20 09:34:32 localhost mariadb: 200320 09:34:32 mysqld_safe Starting mysqld daemon with databases
3月 20 09:34:43 localhost mariadb: ........../etc/init.d/mariadb: 264: kill: No such process
3月 20 09:34:43 localhost mariadb:failed!
3月 20 09:34:43 localhost systemd: mariadb.service: Control process exited, code=exited, status=1/FAIL
3月 20 09:34:43 localhost systemd: mariadb.service: Failed with result 'exit-code'.
3月 20 09:34:43 localhost systemd: Failed to start LSB: start and stop MariaDB.
----------------------------------------------------------------------------------------------------------------------------------------------
root@localhost:~#journalctl -xe
3月 20 09:36:50 localhost systemd: 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: 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: Started Session 3 of user root.
-- Subject: session-3.scope 单元已结束启动
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- session-3.scope 单元已结束启动。
--
-- 启动结果为“done”。

mover_kpr 发表于 2020-3-20 09:56:35

文件系统      容量已用可用 已用% 挂载点
udev            1.9G   01.9G    0% /dev
tmpfs         383M5.5M377M    2% /run
/dev/sdb3      55G   13G   40G   25% /
tmpfs         1.9G   01.9G    0% /dev/shm
tmpfs         5.0M   05.0M    0% /run/lock
tmpfs         1.9G   01.9G    0% /sys/fs/cgroup
tmpfs         383M   0383M    0% /run/user/0

mover_kpr 发表于 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: Starting LSB: start and stop MariaDB...
3月 20 12:18:12 localhost mariadb: Starting MariaDB
3月 20 12:18:12 localhost mariadb: .200320 12:18:12 mysqld_safe Logging to '/usr/local/mariadb/var/
3月 20 12:18:12 localhost mariadb: 200320 12:18:12 mysqld_safe Starting mysqld daemon with database
3月 20 12:18:13 localhost mariadb: /etc/init.d/mariadb: 264: kill: No such process
3月 20 12:18:13 localhost mariadb:failed!
3月 20 12:18:13 localhost systemd: mariadb.service: Control process exited, code=exited, status=1/FAIL
3月 20 12:18:13 localhost systemd: mariadb.service: Failed with result 'exit-code'.
3月 20 12:18:13 localhost systemd: 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   01.9G    0% /dev
tmpfs         383M5.5M377M    2% /run
/dev/sda2      64G5.8G   55G   10% /
tmpfs         1.9G   01.9G    0% /dev/shm
tmpfs         5.0M   05.0M    0% /run/lock
tmpfs         1.9G   01.9G    0% /sys/fs/cgroup
/dev/sda1       922M   60M799M    7% /boot
tmpfs         383M   0383M    0% /run/user/0

mover_kpr 发表于 2020-3-21 09:29:51

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

可我在腾讯云服务器上部署时 /tmp权限是drwxrwxrwt却没有出现任何问题
页: [1]
查看完整版本: mariadb 无法启动