1, new data directory, check the directory is the host permissions, under normal circumstances belong to the MySQL group, MYQL users, because we install MySQL will create a new account and group.
2, the directory permission check is complete, stop the database service.
3, mobile Data directory, I use the MV command to move directly to the new directory.
4, change the configuration file content, mainly has
4.1 The sock path of the client block and the MYSQLD block, and changes to the new path.
4.2 Mysqld Block Check if there is a datadir directory, if no boot is unsuccessful, do not add the configuration item DataDir = new Data Directory
4.3 If you are the Inodb engine, down something else there are 2 Inodb path settings changed.
5. Start the MySQL service
6, ps-ef |grep mysql check the MySQL service directory is correct, such as PID directory, sock directory, DataDir directory and Err directory is the directory you want.
MySQL 5.5.42 change data Catalog CentOS 6.5 environment