You are not logged in.

#1 2017-03-17 19:03:36

Freezee
Member
Registered: 2016-07-05
Posts: 8

[Solved]MariaDB does not start after following wiki installation

After installing MariaDB via pacman, I tried the following command before doing anything else, which the wiki article advices me to do

mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

That unfortunately gives me the following message

Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
2017-03-17 19:23:47 140643789958848 [Note] /usr/sbin/mysqld (mysqld 10.1.21-MariaDB) starting as process 27076 ...
2017-03-17 19:23:47 140643789958848 [ERROR] mysqld: Error writing file '/var/lib/mysql/aria_log_control' (Errcode: 28 "No space left on device")
2017-03-17 19:23:47 140643789958848 [ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2017-03-17 19:23:47 140643789958848 [ERROR] Plugin 'Aria' init function returned error.
2017-03-17 19:23:47 140643789958848 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: The InnoDB memory heap is disabled
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Compressed tables use zlib 1.2.11
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Using Linux native AIO
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Using SSE crc32 instructions
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Completed initialization of buffer pool
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2017-03-17 19:23:47 140643789958848 [Note] InnoDB: Database physically writes the file full: wait...
2017-03-17 19:23:47 7fea2f23eec0 InnoDB: Error: Write to file ./ibdata1 failed at offset 0.
InnoDB: 1048576 bytes should have been written, only 0 were written.
InnoDB: Operating system error number 28.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 28 means 'No space left on device'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2017-03-17 19:23:47 140643789958848 [ERROR] InnoDB: Error in creating ./ibdata1: probably out of disk space
2017-03-17 19:23:47 140643789958848 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2017-03-17 19:23:47 140643789958848 [ERROR] Plugin 'InnoDB' init function returned error.
2017-03-17 19:23:47 140643789958848 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-03-17 19:23:47 140643789958848 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-03-17 19:23:47 140643789958848 [ERROR] Aborting


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/scripts/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.
--general-log gives you a log in /var/lib/mysql 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
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

However I do have enough space available. Trying

 /usr/scripts/scripts/mysql_install_db --defaults-file=~/.my.cnf

does not work because the directory is not found. When I execute

/usr/sbin/mysqld --skip-grant --general-log &

I get the output

[1]  + 31912 suspended (tty output)  sudo /usr/sbin/mysqld --skip-grant --general-log

However continuing with

/usr/bin/mysql

also gives me an error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory")

mysqld --general-log contains the following

2017-03-17 19:38:49 140250657468096 [Note] mysqld (mysqld 10.1.21-MariaDB) starting as process 15282 ...
2017-03-17 19:38:49 140250657468096 [Warning] Can't create test file /var/lib/mysql/arch.lower-test
mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13 "Permission denied")
2017-03-17 19:38:49 140250657468096 [ERROR] Aborting

Obviously I also tried to just start mariadb anyways, which unfortunately does not work as well

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

systemctl status mariadb.service outputs the following

mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2017-03-17 19:40:30 UTC; 30s ago
  Process: 24853 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status
  Process: 24775 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; 
  Process: 24753 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCES
 Main PID: 24853 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Unfortunately I can't make much out of that. journalctl - xe does not seem to have relevant information in it, but here it is anyway

Hint: You are currently not seeing messages from other users and the system.
-- Subject: Unit UNIT has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Subject: Unit UNIT has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has begun starting up.
Mr 17 18:56:31 arch systemd[597]: Started Update XDG user dir configuration.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Mr 17 18:56:31 arch systemd[597]: Reached target Default.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Mr 17 18:56:31 arch systemd[597]: Startup finished in 46ms.
-- Subject: System start-up is now complete
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- All system services necessary queued for starting at boot have been
-- successfully started. Note that this does not mean that the machine is
-- now idle as services might still be busy with completing start-up.
-- 
-- Kernel start-up required KERNEL_USEC microseconds.
-- 
-- Initial RAM disk start-up required INITRD_USEC microseconds.
-- 
-- Userspace start-up required 46395 microseconds.
Mr 17 18:56:33 arch systemd[597]: Started D-Bus User Message Bus.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Mr 17 18:56:36 arch pulseaudio[681]: bind(): Die Adresse wird bereits verwendet
Mr 17 18:56:36 arch pulseaudio[681]: Failed to load module "module-native-protocol-unix" (argument: ""): initialization failed.
Mr 17 18:56:36 arch pulseaudio[681]: Module load failed.
Mr 17 18:56:36 arch pulseaudio[681]: Hintergrunddienst konnte nicht initialisiert werden.
Mr 17 18:56:36 arch systemd[597]: Starting Sound Service...
-- Subject: Unit UNIT has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has begun starting up.
Mr 17 18:56:40 arch systemd[597]: Started Sound Service.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Mr 17 18:56:42 arch dbus-daemon[692]: Activating service name='org.gnome.GConf'
Mr 17 18:56:42 arch dbus-daemon[692]: Successfully activated service 'org.gnome.GConf'
Mr 17 18:57:08 arch sudo[4095]: pam_unix(sudo:auth): authentication failure; logname= uid=1000 euid=0 tty=/dev/pts/0 ruser=brian rhost=  user=root
Mr 17 19:02:14 arch sudo[1314]: pam_unix(sudo:auth): authentication failure; logname= uid=1000 euid=0 tty=/dev/pts/0 ruser=brian rhost=  user=root

I tried everything suggested this thread, without success. Any advice would be welcome.

Last edited by Freezee (2017-03-19 16:43:06)

Offline

#2 2017-03-17 19:40:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,514
Website

Re: [Solved]MariaDB does not start after following wiki installation

Thanks for posting all the relevant diagnostic information.  If you don't mind, however, I'd like to confirm one of your first checks that there is indeed useable space available.  Can you share the output of the following:

findmnt -Do TARGET,SOURCE,USED,SIZE,OPTIONS

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2017-03-17 19:48:58

Freezee
Member
Registered: 2016-07-05
Posts: 8

Re: [Solved]MariaDB does not start after following wiki installation

Sure. Here is the output:

TARGET   SOURCE      USED   SIZE OPTIONS
/dev     dev            0   7,8G rw,nosuid,relatime,size=8154844k,nr_inodes=2038711,mode=755
/run     run         844K   7,8G rw,nosuid,nodev,relatime,mode=755
/        /dev/sda3    19G  19,6G rw,relatime,data=ordered
/dev/shm tmpfs       205M   7,8G rw,nosuid,nodev
/sys/fs/cgroup
         tmpfs          0   7,8G ro,nosuid,nodev,noexec,mode=755
/boot    /dev/sda1    33M  1022M rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,erro
/tmp     tmpfs        24K   7,8G rw,nosuid,nodev
/home    /dev/sda4 122,3G 200,6G rw,relatime,data=ordered
/mnt/HDD /dev/sdb2  54,8G 916,8G rw,noatime,data=ordered
/run/user/1000
         tmpfs        12K   1,6G rw,nosuid,nodev,relatime,size=1631952k,mode=700,uid=1000,gid=100

As you can see only /dev/sda3 is kind off close to its capacity, but there is still 600mb free, which should be enough to at least be able to start MariaDB? Excuse me if the mistake lies here, that would be kind off stupid on my part, but I don't see why 600mb would not be enough. Also I have reinstalled MariaDB a couple of times and I have gotten different error messages (not related to disk space) the first few times, unfortunately I can't remember those anymore.

Last edited by Freezee (2017-03-17 19:51:14)

Offline

#4 2017-03-18 14:21:08

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved]MariaDB does not start after following wiki installation

What filesystem are you using on /?
By default ext filesystems reserve 5% of their space for roots use only (to stop runaway user processes bringing down the system). I believe that MariaDB runs as the mysql user, so won't be able to write to the drive if you have less than around 950MB free.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2017-03-18 15:01:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,514
Website

Re: [Solved]MariaDB does not start after following wiki installation

I suspect that is the problem, or at least is suspect enough that it should be ruled out first by freeing up a good ammount of space.  How is you root parition using 19G?  You'd have to install virtually every single package in the repos to use that space.  Or to you have logs/journals that are growing out of control?  If so, this is usually a sign of a problem that should be dealt with.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2017-03-18 18:56:53

Freezee
Member
Registered: 2016-07-05
Posts: 8

Re: [Solved]MariaDB does not start after following wiki installation

Thank you for this, I now searched for reasons about why my root partition is almost full. I found this topic and after doing

sudo pacman -Sc

my root partition is not 13.9G large, so I guess that should be freed up enough for MariaDB to work? However when trying

mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

I get the following error

Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
2017-03-18 19:55:13 140615066848960 [Note] /usr/sbin/mysqld (mysqld 10.1.21-MariaDB) starting as process 1643 ...
2017-03-18 19:55:13 140615066848960 [ERROR] mysqld: Got error 'Size of control file is smaller than expected' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2017-03-18 19:55:13 140615066848960 [ERROR] Plugin 'Aria' init function returned error.
2017-03-18 19:55:13 140615066848960 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: The InnoDB memory heap is disabled
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: Compressed tables use zlib 1.2.11
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: Using Linux native AIO
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: Using SSE crc32 instructions
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-03-18 19:55:14 140615066848960 [Note] InnoDB: Completed initialization of buffer pool
2017-03-18 19:55:14 140615066848960 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 0 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
2017-03-18 19:55:14 140615066848960 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2017-03-18 19:55:14 140615066848960 [ERROR] Plugin 'InnoDB' init function returned error.
2017-03-18 19:55:14 140615066848960 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-03-18 19:55:14 140615066848960 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-03-18 19:55:14 140615066848960 [ERROR] Aborting


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/scripts/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/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 /var/lib/mysql 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
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

Edit: Oh and the filesystem on / is ext4
Edit2: After freeing up the space I simply reinstalled MariaDB and now it is working. Thank you!

Last edited by Freezee (2017-03-19 16:42:53)

Offline

Board footer

Powered by FluxBB