mysql  data 디렉터리를 변경

 

 

※ 변경 방법

[root@localhost root]#/etc/init.d/mysqld stop

일단 변경할 디렉토리를 생성

[root@localhost]#mkdir /usr/local/src/mysqldata

[root@localhost]#vi /etc/my.cnf

[mysqld]

port = 3306

socket = /tmp/mysql.sock

skip-external-locking

key_buffer_size = 384M

max_allowed_packet = 1M

table_open_cache = 512

sort_buffer_size = 2M

read_buffer_size = 2M

read_rnd_buffer_size = 8M

myisam_sort_buffer_size = 64M

thread_cache_size = 8

query_cache_size = 32M

# Try number of CPU’s*2 for thread_concurrency

thread_concurrency = 8

datadir=/usr/local/src/data // 이부분으로 수정

 

위 작업 후에 기존에 mysqld data의 내용을 /usr/local/src/mysqldata로 옮긴다

[root@localhost root]#cp -arp /usr/local/mysql/data/ /usr/local/src/

[root@localhost root]#/etc/ini.t/mysqld start

Posted by pysany
,