patternsqlMinor
Failed to start MySQL Community Server
Viewed 0 times
communitymysqlfailedstartserver
Problem
A lot of stuff stopped working on my server because the sda3 partition became full. After fixing that issue, I cannot start the mysql service:
If anybody could help me with this problem, I would be greatly appreciative. Thanks!
root@abcd:~# sudo service mysql start
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
root@abcd:~# systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-09-28 22:44:46 UTC; 4s ago
Process: 9276 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
Process: 9255 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Sep 28 22:44:46 abcd systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Sep 28 22:44:46 abcd systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Sep 28 22:44:46 abcd systemd[1]: Stopped MySQL Community Server.
Sep 28 22:44:46 abcd systemd[1]: mysql.service: Start request repeated too quickly.
Sep 28 22:44:46 abcd systemd[1]: mysql.service: Failed with result 'exit-code'.
Sep 28 22:44:46 abcd systemd[1]: Failed to start MySQL Community Server.If anybody could help me with this problem, I would be greatly appreciative. Thanks!
Solution
Seems to be many errors
do this and then have a look on log again
Decrease the value of innodb-buffer-pool size in the config file
Looks like /var/lib/mysql is owned by the mysql user and the group is set to mysql as well.
Have you checked that the directory /var/lib/mysql does actually exist and corresponds to your data directory? If it does not, then you probably must specify otherwise the datadir parameter under the mysqld section
Then you can chose between configuring apparmor to allow MySQL to read\execute\modify the new data directory and sub directories or, at your very own risk, you can remove apparmor. You may need to be root to do the following:
Source:
https://dba.stackexchange.com/questions/106085/cant-create-file-var-lib-mysql-user-lower-test
do this and then have a look on log again
Decrease the value of innodb-buffer-pool size in the config file
/etc/mysql/my.cnfinnodb_buffer_pool_size = 10MLooks like /var/lib/mysql is owned by the mysql user and the group is set to mysql as well.
$ sudo chown -R mysql /var/lib/mysql
$ sudo chgrp -R mysql /var/lib/mysql
$ sudo chmod 755 /var/lib/mysqlHave you checked that the directory /var/lib/mysql does actually exist and corresponds to your data directory? If it does not, then you probably must specify otherwise the datadir parameter under the mysqld section
[mysqld]
datadir=/var/lib/mysqlThen you can chose between configuring apparmor to allow MySQL to read\execute\modify the new data directory and sub directories or, at your very own risk, you can remove apparmor. You may need to be root to do the following:
/etc/init.d/apparmor stop
/etc/init.d/apparmor teardown
update-rc.d -f apparmor remove
apt-get purge apparmor
rebootSource:
https://dba.stackexchange.com/questions/106085/cant-create-file-var-lib-mysql-user-lower-test
Code Snippets
[mysqld]
datadir=/var/lib/mysql/etc/init.d/apparmor stop
/etc/init.d/apparmor teardown
update-rc.d -f apparmor remove
apt-get purge apparmor
rebootContext
StackExchange Database Administrators Q#219246, answer score: 4
Revisions (0)
No revisions yet.