0

I have a Vagrant machine to run Symfony and it does a lot of interaction with a MySQL database. To try to speed it up a little bit I though about using a tmpfs file system for the data dir. The data dir is located at /var/lib/mysql, so here's what I tried:

1) stop the mysql service: sudo service mysql stop

2) mount the tmpfs: sudo mount -t tmpfs -o size=512M tmpfs /var/lib/mysql

3) start mysql: sudo service mysql start

And then I get the following error:

Job for mysql.service failed. See "systemctl status mysql.service" and "journalctl -xe" for details.

systemctl status mysql.service output is:

● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit) since Tue 2016-04-05 20:30:52 UTC; 1min 58s ago
Process: 3376 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
Process: 3375 ExecStart=/usr/bin/mysqld_safe (code=exited, status=0/SUCCESS)
Process: 3839 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Main PID: 3375 (code=exited, status=0/SUCCESS)

Apr 05 20:30:52 libe systemd[1]: mysql.service holdoff time over, scheduling restart.
Apr 05 20:30:52 libe systemd[1]: start request repeated too quickly for mysql.service
Apr 05 20:30:52 libe systemd[1]: Failed to start MySQL Community Server.
Apr 05 20:30:52 libe systemd[1]: Unit mysql.service entered failed state.
Apr 05 20:30:52 libe systemd[1]: mysql.service failed.

Which doesn't give too much information... Any ideas on how to debug this or what I'm doing wrong? Thanks!

Mustofa Rizwan
  • 10,215
  • 2
  • 28
  • 43
petekaner
  • 8,071
  • 5
  • 29
  • 52
  • Read [this](http://2bits.com/articles/reduce-your-servers-resource-usage-moving-mysql-temporary-directory-ram-disk.html) and [this](http://dba.stackexchange.com/questions/20649/how-to-setup-mysql-on-tmpfs) – Kamil Gosciminski Apr 05 '16 at 20:39
  • Install a database there with `mysql_install_db` (or copy over an existing database there). Keep in mind mount isn't an overlay, it replaces all the content that is there (fun way to hide some... 'special' files...) – Wrikken Apr 05 '16 at 23:16
  • Is there anything in `/var/log/mysql/*` ? – Brian Brownton Apr 06 '16 at 13:25

0 Answers0