Перенос mysql в другой каталог

Очень много вопросов по данной теме и не менее ошибок в алгоритме переноса.

service mysql stop
cp -rp /var/lib/mysql /sites
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf

/etc/my.cnf — приводим к примерно такому виду:

[client]
#password = your_password
port = 3306
socket = /sites/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
datadir = /sites/mysql
socket = /sites/mysql/mysql.sock
skip-external-locking
low-priority-updates
wait_timeout = 60
connect_timeout = 20
key_buffer_size = 1024M
max_allowed_packet = 8M
table_open_cache = 512
sort_buffer_size = 64M
read_buffer_size = 8M
read_rnd_buffer_size = 1M
myisam_sort_buffer_size = 512M
thread_cache_size = 32
#query_cache_size = 8G
#query_cache_limit = 8G
#join_buffer_size = 16M
tmp_table_size = 256M
max_heap_table_size = 2G
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 8
max_connections = 200
#log-bin=mysql-bin
server-id = 1

[mysqldump]
quick
max_allowed_packet = 64M

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

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Создаем симлинк в /var/lib/mysql, выставляем пользователя:

chown -R mysql:mysql /var/lib/mysql

service mysql start

Запустилось? А то.

mysql_secure_installation

и т.д.


Понравилась статья? Поделись с остальными.

Комментарии закрыты.