I've been looking to make an automatic backup of a MySQL database, by adding a line to crontab, and using mysqldump
I'm using xampp and Ubuntu 10.10
My problem is that when I execute mysql or mysqldump I get
ERROR 2002 (HY000): Can't connect to local MySQL server through socket 'opt/lampp/var/mysqld/mysqld.sock' (2)
The command ps -ef | grep mysql shows the following (mySQL is running)
- Code: Select all
root 1484 1 0 07:35 ? 00:00:00 /bin/sh /opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql --pid-file=/opt/lampp/var/mysql/ubuntukikebeza.pid
nobody 1845 1484 0 07:35 ? 00:00:02 /opt/lampp/sbin/mysqld --basedir=/opt/lampp --datadir=/opt/lampp/var/mysql --plugin-dir=/opt/lampp/lib/mysql/plugin --user=nobody --log-error=/opt/lampp/var/mysql/ubuntukikebeza.err --pid-file=/opt/lampp/var/mysql/ubuntukikebeza.pid --socket=/opt/lampp/var/mysql/mysql.sock --port=3306
enrique 9237 2045 0 09:25 pts/0 00:00:00 grep --color=auto mysql
This is my my.cnf file:
- Code: Select all
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
bind-address = 127.0.0.1
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/
And finally,
- my xampp is located in /opt/lampp
- I can work fine with phpmyadmin, my scripts connect to mysql perfectly, etc.
Does any1 know what's the problem?
Thanks a lot in advance,