- Stop MySQL Repair
* Sudo/etc/init.d/mysql stop
- Copy of the original folder
* cp-r/var/lib/mysql/home/yourname/somewhere
Change permissions
* sudo chmod mysql:root/home/yourname/somewhere/mysql
* sudo chmod 777/home/yourname/somewhare/mysql
Editing a configuration file/etc/mysql/my.cnf
* Change DataDir to/home/yourname/somewhere/mysql
Edit Ubuntu-specific permissions control AppArmor configuration file
* Vi/etc/apparmor.d/usr.sbin/mysqld
* Change two behavior/var/lib/mysql/for your folder/home/yourname/sowewhere/
* Be careful not to forget the trailing slash. Otherwise it will show databases time error
- Loading configuration again
* /etc/init.d/apparmor Reload
* /etc/init.d/mysql start
It's just not going to restart.
Verification: Mysql-u Root-p
Show databases
Copyright notice: This article Bo Master original articles, blogs, without consent, may not be reproduced.
How Ubuntu changes the MySQL default folder Data folder