MySQL at startup

Thanks to Changomarcelo for his help.

So much for my MySQL startup. I have installed Marc Liyanage's 3.23.45 package and the startup item. The latter appears to be working, but I can't connect (error 61).

/usr/local/mysql/data/localhost.err reveals:
020107 8:24:27 /usr/local/mysql-3.23.45/bin/mysqld: Can't create/write to file '/usr/local/mysql-3.23.45/data/localhost.pid' (Errcode: 13)
020107 8:24:27 /usr/local/mysql-3.23.45/bin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
020107 8:24:27 /usr/local/mysql-3.23.45/bin/mysqld: Error on delete of '/usr/local/mysql-3.23.45/data/localhost.pid' (Errcode: 13)


I tried restarting using the mysqld daemon:
localhost:/usr/local/mysql] david% ./bin/safe_mysqld --user=mysql &
[1] 5178
[localhost:/usr/local/mysql] david% touch: /usr/local/mysql/data/localhost.err: Permission denied
chown: /usr/local/mysql/data/localhost.err: Operation not permitted
Starting mysqld daemon with databases from /usr/local/mysql/data
./bin/safe_mysqld: permission denied: /usr/local/mysql/data/localhost.err [229]
rm: /tmp/mysql.sock: Operation not permitted
./bin/safe_mysqld: permission denied: /usr/local/mysql/data/localhost.err [235]
tee: /usr/local/mysql/data/localhost.err: Permission denied
020107 11:05:53 mysqld ended


But the localhost.err file ends with the lines I quoted above (which occurred when the startup item ran). Has anyone any ideas?

Many thanks,
David
 
020107 8:24:27 /usr/local/mysql-3.23.45/bin/mysqld: Can't create/write to file '/usr/local/mysql-3.23.45/data/localhost.pid' (Errcode: 13)

This sure looks like a permissions issue. Did you do this step from Marc's instructions?:

sudo chown -R mysql /usr/local/mysql/*
 
Slur wrote:
This sure looks like a permissions issue. Did you do this step from Marc's instructions?
sudo chown -R mysql /usr/local/mysql/*


Sure did. Followed his instructions to the letter on the day I installed MySQL. I was then able to use the mysql command. But the next day (in other words, from the next startup), I got the error I quoted above. Do you think I should run that command again?

It sure would be a pain to have to do this every day!

In any case, MySQL is not running. The command ps -aux | grep mysqld reveals:
david 378 0.0 0.0 1112 196 std R+ 0:00.00 grep mysqld

My understanding from a message you wrote in another forum is that mysqld should remain running after starting the mysql server.

Incidentally, this does not happen with Postgres. It is running and I am able to use its console program and phpPgAdmin.

Regards, David
 
It looks like your directory permissions are not set correctly. mysqld is trying to create the process id file ... you will find that directory as /usr/local/mysql/data.

cd into /usr/local/mysql ... do an ls -ld data ... it should come up with:
drwxr-w--- as the permissions.

I would suggest doing the following while in the /usr/local/mysql directory:
sudo chmod -R u+rwx .
sudo chmod -R g+rw .
sudo chmod -R o-rwx .

There are three seperate commands.
Good luck,
__nether
 
My apologies for no replying sooner.

It turns out that both nether and slur were correct. I simply ran the line
sudo chown -R mysql /usr/local/mysql/*
which fixed the problem.

It's a bit puzzling that I did this when I installed it. (I know this for a fact; I recorded my actions in a separate text file just in case something went wrong and I had to ask you knowledgable folks about it.) Why it didn't work after the first day I don't know. Anyway, it's working now every day!

Many thanks,
David
 
Back
Top