MariaDB won't start

Discussion in 'Installation/Configuration' started by Tomislav Aurednik, Mar 31, 2017.

  1. I'm running only into problems the last few days. I Installed mariadb on my Ubuntu 16.04 lts server.
    apt-get install mariadb-server maridb-client
    comment out the bind addres in vi /etc/mysql/mariadb.conf.d/50-server.cnf
    restarted it and it worked. Then I stopped it. After that it won't start again.
    systemctl status mysql.service output:
    mysql.service - LSB: Start and stop the mysql database server daemon
    Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
    Active: failed (Result: exit-code) since Fri 2017-03-31 14:42:44 CEST; 10s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 4422 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

    Mar 31 14:42:44 tmysql1 /etc/init.d/mysql[4904]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    Mar 31 14:42:44 tmysql1 /etc/init.d/mysql[4904]: [61B blob data]
    Mar 31 14:42:44 tmysql1 /etc/init.d/mysql[4904]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")'
    Mar 31 14:42:44 tmysql1 /etc/init.d/mysql[4904]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
    Mar 31 14:42:44 tmysql1 /etc/init.d/mysql[4904]:
    Mar 31 14:42:44 tmysql1 mysql[4422]: ...fail!
    Mar 31 14:42:44 tmysql1 systemd[1]: mysql.service: Control process exited, code=exited status=1
    Mar 31 14:42:44 tmysql1 systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
    Mar 31 14:42:44 tmysql1 systemd[1]: mysql.service: Unit entered failed state.
    Mar 31 14:42:44 tmysql1 systemd[1]: mysql.service: Failed with result 'exit-code'.​

    journalctl -xe output:
    Mar 31 14:44:02 tmysql1 mysql[4920]: * Starting MariaDB database server mysqld
    Mar 31 14:44:02 tmysql1 mysqld_safe[5086]: Starting mysqld daemon with databases from /var/lib/mysql
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] /usr/sbin/mysqld (mysqld 10.0.29-MariaDB-0ubuntu0.16.04.1) starting as process 5090 ...
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Using mutexes to ref count buffer pool pages
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: The InnoDB memory heap is disabled
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Compressed tables use zlib 1.2.8
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Using Linux native AIO
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Using CPU crc32 instructions
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Initializing buffer pool, size = 128.0M
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Completed initialization of buffer pool
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Highest supported file format is Barracuda.
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Database was not shutdown normally!
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Starting crash recovery.
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Reading tablespace information from the .ibd files...
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Restoring possible half-written data pages
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: from the doublewrite buffer...
    Mar 31 14:44:02 tmysql1 mysqld[5091]: InnoDB: Doing recovery: scanned up to log sequence number 1600607
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Starting an apply batch of log records to the database...
    Mar 31 14:44:02 tmysql1 mysqld[5091]: InnoDB: Progress in percent: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
    Mar 31 14:44:02 tmysql1 mysqld[5091]: InnoDB: Apply batch completed
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: 128 rollback segment(s) are active.
    Mar 31 14:44:02 tmysql1 mysqld[5091]: 170331 14:44:02 [Note] InnoDB: Waiting for purge to start
    Mar 31 14:44:03 tmysql1 mysqld[5091]: 170331 14:44:03 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.34-79.1 started; log sequence number 1600607
    Mar 31 14:44:03 tmysql1 mysqld[5091]: 170331 14:44:03 [Note] Plugin 'FEEDBACK' is disabled.
    Mar 31 14:44:03 tmysql1 mysqld[5091]: 170331 14:44:03 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    Mar 31 14:44:03 tmysql1 mysqld[5091]: 170331 14:44:03 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
    Mar 31 14:44:03 tmysql1 mysqld[5091]: 170331 14:44:03 [Note] Server socket created on IP: '::'.
    Mar 31 14:44:03 tmysql1 mysqld[5091]: 170331 14:44:03 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
    Mar 31 14:44:03 tmysql1 mysqld_safe[5118]: mysqld from pid file /var/run/mysqld/mysqld.pid ended
    Mar 31 14:44:33 tmysql1 /etc/init.d/mysql[5397]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    Mar 31 14:44:33 tmysql1 /etc/init.d/mysql[5397]: [61B blob data]
    Mar 31 14:44:33 tmysql1 /etc/init.d/mysql[5397]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")'
    Mar 31 14:44:33 tmysql1 /etc/init.d/mysql[5397]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
    Mar 31 14:44:33 tmysql1 /etc/init.d/mysql[5397]:
    Mar 31 14:44:33 tmysql1 mysql[4920]: ...fail!
    Mar 31 14:44:33 tmysql1 systemd[1]: mysql.service: Control process exited, code=exited status=1
    Mar 31 14:44:33 tmysql1 systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
    -- Subject: Unit mysql.service has failed
    -- Defined-By: systemd
    I looked at the permisions but they seem ok. The /var/log/mysql/error.log has only entrys until the stop, nothing after that.
     
  2. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    According to the ERRORs some mysql-tables are missing.
    You can also check, if mysql is not running with ps -ef|grep mysql
     
  3. yeah I know but I can't create because I can't start the service them. in /var/log/syslog I have:

    Apr 1 08:51:51 tmysql1 mysqld: 170401 8:51:51 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    Apr 1 08:51:51 tmysql1 mysqld: 170401 8:51:51 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
    Apr 1 08:51:51 tmysql1 mysqld: 170401 8:51:51 [Note] Server socket created on IP: '::'.
    Apr 1 08:51:51 tmysql1 mysqld: 170401 8:51:51 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
    Apr 1 08:51:51 tmysql1 mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
    Apr 1 08:52:21 tmysql1 /etc/init.d/mysql[25792]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    Apr 1 08:52:21 tmysql1 /etc/init.d/mysql[25792]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
    Apr 1 08:52:21 tmysql1 /etc/init.d/mysql[25792]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or
    directory")'
    Apr 1 08:52:21 tmysql1 /etc/init.d/mysql[25792]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
    Apr 1 08:52:21 tmysql1 /etc/init.d/mysql[25792]:
    Apr 1 08:52:21 tmysql1 mysql[25314]: ...fail!
    Apr 1 08:52:21 tmysql1 systemd[1]: mysql.service: Control process exited, code=exited status=1
    Apr 1 08:52:21 tmysql1 systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
    Apr 1 08:52:21 tmysql1 systemd[1]: mysql.service: Unit entered failed state.
    Apr 1 08:52:21 tmysql1 systemd[1]: mysql.service: Failed with result 'exit-code'.

    Running your command
    root@tmysql1:/var/log# ps -ef|grep mysql
    root 1242 2 0 Mar31 ? 00:00:00 [drbd_w_mysql]
    root 1256 2 0 Mar31 ? 00:00:00 [drbd_r_mysql]
    root 1465 2 0 Mar31 ? 00:00:00 [drbd_a_mysql]
    root 25825 24002 0 09:00 pts/0 00:00:00 grep --color=auto mysql

    The worst thing is that it's a fresh install of Ubuntu 16.04 and mariadb. I configured it like it's in https://www.howtoforge.com/tutorial...l-pureftpd-bind-postfix-doveot-and-ispconfig/
     
  4. kinda solved it...
    added it to repo
    apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
    add-apt-repository 'deb [arch=amd64,i386] http://sgp1.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial main'

    run apt-get update && apt-get upgrade
    purged it apt purge mariadb-server mariadb-client
    apt autoremove
    installed it again apt-get install mariadb-server mariadb-client

    now it works. But if I have to do this everytime I want to install a server with mariadb it will be a hassle. Google is full of similar errors for mysql and ubuntu 16.04 so is it broken that much. The mysql-server has evem a hard dependency for apparmor.
     
  5. nope not working... now it starts and runs but it still not work. when I try to use mysql (mysql -u root -p) I get another error ERROR 1524 (HY000): Plugin 'unix_socket' is not loaded
     

Share This Page