Question

Job for mysqld.service failed See “systemctl status mysqld.service , journalctl -xe & tail -30 /var/log/mysql/error.log "

I don’t know what i have to do now seeing this error(mysql.service won’t start) bcz i’m that much linux guy… Pls give some solution asap

systemctl status mysqld.service

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Wed 2017-08-23 19:17:34 UTC; 24s ago
  Process: 26606 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 26597 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 26606 (code=exited, status=1/FAILURE);         : 26607 (mysql-systemd-s)
    Tasks: 2
   Memory: 324.0K
      CPU: 520ms
   CGroup: /system.slice/mysql.service
           └─control
             ├─26607 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─26676 sleep 1

Aug 23 19:17:34 ubuntu-1gb-nyc3-01 systemd[1]: Starting MySQL Community Server...
Aug 23 19:17:35 ubuntu-1gb-nyc3-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

journalctl -xe

-- Unit mysql.service has begun starting up.
Aug 23 19:19:05 ubuntu-1gb-nyc3-01 audit[26888]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26888/status" pid=2688
Aug 23 19:19:05 ubuntu-1gb-nyc3-01 audit[26888]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" p
Aug 23 19:19:05 ubuntu-1gb-nyc3-01 audit[26888]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26888/status" pid=2688
Aug 23 19:19:05 ubuntu-1gb-nyc3-01 kernel: audit: type=1400 audit(1503515945.954:748): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Aug 23 19:19:05 ubuntu-1gb-nyc3-01 kernel: audit: type=1400 audit(1503515945.954:749): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Aug 23 19:19:05 ubuntu-1gb-nyc3-01 kernel: audit: type=1400 audit(1503515945.954:750): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Aug 23 19:19:06 ubuntu-1gb-nyc3-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Aug 23 19:19:23 ubuntu-1gb-nyc3-01 sshd[26930]: Connection closed by 116.31.116.40 port 40327 [preauth]
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 systemd[1]: mysql.service: Unit entered failed state.
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 systemd[1]: mysql.service: Failed with result 'exit-code'.
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 audit[26981]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26981/status" pid=2698
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 audit[26981]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" p
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 audit[26981]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26981/status" pid=2698
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 kernel: audit: type=1400 audit(1503515976.446:751): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 kernel: audit: type=1400 audit(1503515976.446:752): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Aug 23 19:19:36 ubuntu-1gb-nyc3-01 kernel: audit: type=1400 audit(1503515976.446:753): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Aug 23 19:19:37 ubuntu-1gb-nyc3-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Aug 23 19:19:48 ubuntu-1gb-nyc3-01 sudo[27025]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/journalctl -xe
Aug 23 19:19:48 ubuntu-1gb-nyc3-01 sudo[27025]: pam_unix(sudo:session): session opened for user root by root(uid=0)

tail -30 /var/log/mysql/error.log


2017-08-23T19:22:08.951104Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-08-23T19:22:08.951207Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-08-23T19:22:09.177161Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-23T19:22:09.181318Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.19-0ubuntu0.16.04.1) starting as process 27514 ...
2017-08-23T19:22:09.190896Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-08-23T19:22:09.190945Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-08-23T19:22:09.190960Z 0 [Note] InnoDB: Uses event mutexes
2017-08-23T19:22:09.190971Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-08-23T19:22:09.190980Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-08-23T19:22:09.190990Z 0 [Note] InnoDB: Using Linux native AIO
2017-08-23T19:22:09.191768Z 0 [Note] InnoDB: Number of pools: 1
2017-08-23T19:22:09.192044Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-08-23T19:22:09.195523Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-08-23T19:22:09.213977Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-08-23T19:22:09.219177Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-08-23T19:22:09.233451Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-08-23T19:22:09.252993Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-08-23T19:22:09.253125Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-08-23T19:22:09.264465Z 0 [Warning] InnoDB: 1048576 bytes should have been written. Only 851968 bytes written. Retrying for the remaining bytes.
2017-08-23T19:22:09.264519Z 0 [Warning] InnoDB: Retry attempts for writing partial data failed.
2017-08-23T19:22:09.264539Z 0 [ERROR] InnoDB: Write to file ./ibtmp1failed at offset 5242880, 1048576 bytes should have been written, only 851968 were written. Operating system error number 28. Check that your OS and file s2017-08-23T19:22:09.866980Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-08-23T19:22:09.867026Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-08-23T19:22:09.867033Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-08-23T19:22:09.867040Z 0 [ERROR] Failed to initialize plugins.
2017-08-23T19:22:09.867043Z 0 [ERROR] Aborting

2017-08-23T19:22:09.867049Z 0 [Note] Binlog end
2017-08-23T19:22:09.867098Z 0 [Note] Shutting down plugin 'MyISAM'
2017-08-23T19:22:09.867485Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

and i’m using ubuntu 16.04(1gb) Droplet

Thanks in advance

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You should first setup a swapfile. and also add line like this innodb_buffer_pool_size = 20M to the end of the line of your /etc/mysql/my.cnf

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
innodb_buffer_pool_size = 20M```

@Aprexer

I tried start and stop mysql.service and install mysql tuner… and try to open my.cnf … that’s it

Could you let us know what you’ve already tried to do to resolve your issue? Have you googled your error? If so have you tried those solutions? Have you tried purging mysql-server and start again?