ubuntu18.04安装mariadb,重启系统后启动不了mariadb

天涯明月稻 发布于 2018/11/27 09:44
阅读 179
收藏 0

在ubuntu18.04系统中使用apt安装了mariaDB,安装好后可以使用sudo mysql进入,后为了开发便利,创建了一个新的用户可以在普通用户权限下连接数据库,到目前为止还一切安好。但第二天我再启动电脑时,数据库服务就没起来,使用systemctl start mariadb.service启动服务也失败,查看状态有如下显示,提示timeout

mariadb.service - MariaDB 10.1.34 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Tue 2018-11-27 09:30:18 CST; 9min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 3800 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 3712 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-
  Process: 3710 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 3709 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 3800 (code=exited, status=0/SUCCESS)

11月 27 09:28:45 jaronPC systemd[1]: Starting MariaDB 10.1.34 database server...
11月 27 09:28:45 jaronPC mysqld[3800]: 2018-11-27  9:28:45 140488153525376 [Note] /usr/sbin/mysqld (mysqld 10.1.34-MariaDB-0ubuntu0.18.04.1) starting a
11月 27 09:30:15 jaronPC systemd[1]: mariadb.service: Start operation timed out. Terminating.
11月 27 09:30:18 jaronPC systemd[1]: mariadb.service: Failed with result 'timeout'.
11月 27 09:30:18 jaronPC systemd[1]: Failed to start MariaDB 10.1.34 database server.

然后查看/var/log/mysql/error.log日志,显示如下:

2018-11-27  9:28:45 140488153525376 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: The InnoDB memory heap is disabled
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Compressed tables use zlib 1.2.11
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Using Linux native AIO
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Using SSE crc32 instructions
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Completed initialization of buffer pool
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Highest supported file format is Barracuda.
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: 128 rollback segment(s) are active.
2018-11-27  9:28:46 140488153525376 [Note] InnoDB: Waiting for purge to start
2018-11-27  9:28:46 140488153525376 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.39-83.1 started; log sequence number 1616767
2018-11-27  9:28:46 140488153525376 [Note] Plugin 'FEEDBACK' is disabled.
2018-11-27  9:28:46 140487486863104 [Note] InnoDB: Dumping buffer pool(s) not yet started
2018-11-27  9:28:46 140488153525376 [Note] Server socket created on IP: '127.0.0.1'.
2018-11-27  9:28:46 140488153525376 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.34-MariaDB-0ubuntu0.18.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Ubuntu 18.04
2018-11-27  9:30:15 140488152954624 [Note] /usr/sbin/mysqld: Normal shutdown
2018-11-27  9:30:15 140488152954624 [Note] Event Scheduler: Purging the queue. 0 events
2018-11-27  9:30:15 140487545558784 [Note] InnoDB: FTS optimize thread exiting.
2018-11-27  9:30:15 140488152954624 [Note] InnoDB: Starting shutdown...
2018-11-27  9:30:16 140488152954624 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2018-11-27  9:30:17 140488152954624 [Note] InnoDB: Shutdown completed; log sequence number 1616777
2018-11-27  9:30:17 140488152954624 [Note] /usr/sbin/mysqld: Shutdown complete

发现启动完了又自动关闭,是和上面的那个plugin没启用还是dumpping buffer pool not ye started 有关呢,求大神指点。

加载中
0
mickelfeng
mickelfeng

你试试 increase buffer pool at least up to 20MB.

mickelfeng
mickelfeng
回复 @天涯明月稻 : en
天涯明月稻
天涯明月稻
没有用,设置了之后依然是这样
天涯明月稻
天涯明月稻
请问要如何增加,是在配置文件的哪个部分增加,是直接设置innodb_buffer_pool_size的值吗?
0
mickelfeng
mickelfeng

将innodb的ib_logfile*都删除掉之后,重启MySQL试试

0
天涯明月稻
天涯明月稻

引用来自“mickelfeng”的评论

将innodb的ib_logfile*都删除掉之后,重启MySQL试试

还是不行

1月 27 16:38:05 jaronPC systemd[1]: mariadb.service: Start operation timed out. Terminating.
11月 27 16:38:05 jaronPC kernel: audit: type=1400 audit(1543307885.258:331): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC kernel: audit: type=1400 audit(1543307885.362:332): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC kernel: audit: type=1400 audit(1543307885.462:333): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC kernel: audit: type=1400 audit(1543307885.562:334): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC kernel: audit: type=1400 audit(1543307885.658:335): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC kernel: audit: type=1400 audit(1543307885.762:336): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:05 jaronPC kernel: audit: type=1400 audit(1543307885.866:337): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:06 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:06 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:06 jaronPC kernel: audit: type=1400 audit(1543307886.866:338): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:06 jaronPC kernel: audit: type=1400 audit(1543307886.866:339): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:06 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:06 jaronPC kernel: audit: type=1400 audit(1543307886.874:340): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:07 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:07 jaronPC audit[2313]: AVC apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2313 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=122 ouid=0
11月 27 16:38:07 jaronPC systemd[1]: mariadb.service: Failed with result 'timeout'.
11月 27 16:38:07 jaronPC systemd[1]: Failed to start MariaDB 10.1.34 database server.
-- Subject: mariadb.service 单元已失败
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

 

0
mickelfeng
mickelfeng

还没用过systemctl 这个工具, mysqld_safe进程启动具体看什么原因

0
天涯明月稻
天涯明月稻

今天打开,又可以了,不知道是为什么,可能是按@mickelfeng说的改了一下配置文件吧,可能改了之后需要重启系统,真的不知道为什么,后面再看一下,如果再出现问题再说吧

返回顶部
顶部