I have recently installed Arch Linux x64 and I wanted to install the LAMP stack. Everything worked fine, until I arrived to the MySQL part that I installed but can't launch. The output of sudo systemctl start mysqld gives :

Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.

and here is the systemctl status mysqld.service output :

* mysqld.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
   Active: activating (start-post) (Result: exit-code) since Fri 2015-07-17 22:31:04 CET; 20s ago
  Process: 9548 ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
 Main PID: 9548 (code=exited, status=1/FAILURE);         : 9549 (mysqld-post)
   CGroup: /system.slice/mysqld.service
             |-9549 /bin/sh /usr/bin/mysqld-post
             `-9743 sleep 1

Jul 17 22:31:04 sn4k3 systemd[1]: Starting MariaDB database server...
Jul 17 22:31:04 sn4k3 mysqld[9548]: 150717 22:31:04 [Note] /usr/bin/mysqld (mysqld 10.0.20-MariaDB-log) starting as process 9548 ...
Jul 17 22:31:04 sn4k3 mysqld[9548]: 150717 22:31:04 [Warning] Can't create test file /var/lib/mysql/sn4k3.lower-test
Jul 17 22:31:04 sn4k3 mysqld[9548]: [96B blob data]
Jul 17 22:31:04 sn4k3 mysqld[9548]: 150717 22:31:04 [ERROR] Aborting
Jul 17 22:31:04 sn4k3 mysqld[9548]: 150717 22:31:04 [Note] /usr/bin/mysqld: Shutdown complete
Jul 17 22:31:04 sn4k3 systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
  • Looks like a permissions issue.
    – jordanm
    Jul 17, 2015 at 20:57

4 Answers 4


Found the solution you just have to run this command :

sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/

source : Archlinux wiki

  • 1
    It work for me (Cent OS 7.2 x64). thanks a lot.. Jul 2, 2016 at 16:38

Also check if your partition is not full, which was my case.

For an unknown reason, moving the data to another partition did not work either.

So for a quick fix, instead of messing with llvm or gparted, I reduced my /swapfile size.

sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/

Reinstalling MySQL might help:

First uninstall the current MySQL Then delete /var/lib/mysql and /etc/mycnf or /etc/mycng.rpmsave Reboot the machine Now install the MySQL again.

  • Reinstalling is usually the worst recommendation since it usually causes more collateral damage than helping. And posting the same bad recommendation over and over again in all threads with this or similar problems doesn't make this recommendation better. Aug 9, 2018 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.