Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed archlinux x64, previously I used a 32-bit Debian. The old operating system still exists (nearly) unmodified, as I bought new disks.

On Arch, but also on Debian, I tried to start mysqld with their respective commands. On both systems it just hangs until it finally gives up and reports failure.

I moved the database from its original location to another path a few months ago, because I was running out of space. I adjusted my.cnf accordingly:

datadir         = /mnt/media/mysql_db

/mnt/media is the exact same LVM drive for both systems. So I mounted it on the new system and it complained about some mysql-bin.index missing, so I copied that file from /var/lib/mysql (it assume it was created when I first ran mysqld with an unmodified configuration). After that it complained about other mysql-bin.* files, so I copied all of them. This is the only modification, I made to the original folder.

Trying to start again, the logfile /mnt/media/mysql_db/hostname.err did not even get touched anymore. I checked /var/log and any other location I could think of, but no file gets touched by mysql. So now the start commands fails but does not give notice to me why.

So I tried booting into my old system, but here same thing now. I deleted those mysql-bin.* files again, since they weren't intially there anyway, but it still failes and does not give any output.

Any idea how to limit my search or find a solution?

share|improve this question
up vote 1 down vote accepted

I cannot test this at the moment, but it could be a permission problem.

Make sure that the correct ownership and file permissions are set on the datadir and all of the files within it.

The mysql user should own the datadir and permissions on the datadir should be 700 (or drwx------). The mysql user should also own the sub-directories and database files within the datadir. Directories should have their permissions set to 700 (or drwx------) and database files should have their permissions set to 660 (or -rw-rw----). This can all be confirmed with ls -l.

If any permissions are set incorrectly (ie: if you copied the files as root, root now owns them), correct them with chown and chmod.

To change the ownership of a file/directory to mysql, use the following:

chown mysql:mysql /path/to/file

To change the permissions on a file/directory, use the following:

chmod 660 /path/to/file

replacing 660 to the permision you want to set.

share|improve this answer
Yes! I changed the permissions for the new system, but forgot to revert them for the old. Now I can just chroot into my old system and start mysqld from there. Thank you for the idea. – javex Aug 1 '12 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .