{"id":1082,"date":"2013-04-19T19:24:27","date_gmt":"2013-04-19T19:24:27","guid":{"rendered":"http:\/\/invisiblezero.net\/?p=621"},"modified":"2013-04-19T19:24:27","modified_gmt":"2013-04-19T19:24:27","slug":"mysql-change-data-directory-base","status":"publish","type":"post","link":"http:\/\/ndthanh.com\/mysql-change-data-directory-base\/","title":{"rendered":"MySQL – Change data directory (base)"},"content":{"rendered":"

\"banner-moving\"<\/p>\n

MySQL is a widely used and fast SQL database server. It is a client\/server implementation that consists of a server daemon (mysqld) and many different client programs\/libraries.<\/p>\n

Mysql data directory is important part where all the mysql databases storage location.By default MySQL data default directory located in \/var\/lib\/mysql.If you are running out of space in \/var partition you need to move this to some other location.<\/p>\n

Note:- This is only for advanced users and before moving default directory make a backup of your mysal databases.<\/p>\n

<\/p>\n

First you should stop the mysql server. e.g.<\/p>\n

\n # \/etc\/init.d\/mysql stop\n\n<\/pre>\n

After that you should copy the old data directory (e.g. \/var\/lib\/mysql) incl. privileges to your new directory via<\/p>\n

\n # cp -R -p \/var\/lib\/mysql \/new\/data\/dir\n\n<\/pre>\n

now you can change in \/etc\/mysql\/my.cnf the data new and restart the server<\/p>\n

\n # \/etc\/init.d\/mysql restart\n\n<\/pre>\n

You have to copy the database when the server is not running.<\/p>\n","protected":false},"excerpt":{"rendered":"

MySQL is a widely used and fast SQL database server. It is a client\/server implementation that consists of a server daemon (mysqld) and many different client programs\/libraries. Mysql data directory is important part where all the mysql databases storage location.By default MySQL data default directory located in \/var\/lib\/mysql.If you are running out of space in…<\/p>\n

Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,91],"tags":[93,62],"aioseo_notices":[],"views":8,"_links":{"self":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts\/1082"}],"collection":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/comments?post=1082"}],"version-history":[{"count":0,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts\/1082\/revisions"}],"wp:attachment":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/media?parent=1082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/categories?post=1082"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/tags?post=1082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}