I'm new to mysql and after getting installed and working successfully on Linux I wanted to add in a backup solution to protect my data.
I know how to backup a database using the command mysqldump, but I wanted to add in binary logging, so I can get my database back to exactly where it was if something goes pear shaped.
If I add this to my.cnf file
and restart mysql I get the following errors in the localhost.err file in the data directory:
060116 13:35:03 mysqld started
/usr/local/mysql/bin/mysqld: Can't read dir of '/root/tmp/' (Errcode: 13)
/usr/local/mysql/bin/mysqld: File '/usr/local/mysql/logs/update.index' not found (Errcode: 13)
060116 13:35:03 [ERROR] Aborting
I've narrowed the problem down to running mysql as user mysql, but both the /root/usr/ and /usr/local/mysql/logs/ directory both belonged to root. I changed the /usr/local/mysql/logs directory to be owned by mysql.
I don't want to change /root/tmp/ as it will intefere with other applications.
Does anyone know how to tell mysql to set the socket needed for binary-logging to be in another directory other than /root/temp/ in the my.cnf file?
I made sure /root/tmp had the right rw access and then used the following two commands:
the echo showed that TMPDIR was set to /root/tmp where mysql was trying to right the socket for binary logging. After that it worked even after restarting the machine. It booted with Mysql running with binary logging turned on.