Changed mysql.sock location

JdS

Verified User
Joined
Dec 10, 2005
Messages
6
Location
KUL, Malaysia
Since I had an extra HDD in my server that was rarely being used, I decided to move the mysql data folder (datadir) to this partition. Well, it was done and everything (web sites) seems to be running fine except the Directadmin backup script is still looking for the socket at: /var/lib/mysql/mysql.sock.

Where, or how, do I change this value?

The DA backups fail returning this error message:
Error connecting to MySQL: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Original datadir value: /var/lib/mysql/mysql.sock
New datadir value: /backup/mysql/mysql.sock

Maybe you might need to look at the configuration file:

Code:
[client]
port=3306
socket=/backup/mysql/mysql.sock

# The MySQL server
[mysqld]
connect_timeout=10
datadir=/backup/mysql
innodb_additional_mem_pool_size=10M
innodb_buffer_pool_size=128M
innodb_data_home_dir=/backup/mysql/
innodb_log_arch_dir=/backup/mysql/
innodb_log_buffer_size=4M
innodb_log_file_size=32M
innodb_log_group_home_dir=/backup/mysql/
join_buffer_size=1M
key_buffer=64M
max_allowed_packet=16M
max_connections=300
myisam_sort_buffer_size=64M
port=3306
query_cache_size=32M
read_buffer_size=1M
skip-locking
socket=/backup/mysql/mysql.sock
table_cache=1024
thread_cache_size=64
thread_concurrency=2
wait_timeout=1800

[mysqldump]
quick
max_allowed_packet = 8M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 1M
write_buffer = 1M

[myisamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 1M
write_buffer = 1M

[mysqlhotcopy]
interactive-timeout
and it is saved to: /etc.my.cnf
 
Last edited:
You might want to do a symlink.

ln -s /backup/mysql/mysql.sock /var/lib/mysql/mysql.sock

Actually what you should do is to mount your new harddisk as /var/lib/mysql so that you does not affect any scripts that depends on hard link :)

Hope this helps!
 
Back
Top