1 Step
Need to stop the mysqld service
service mysqld stop
2 step
Create a new data diretory and move the content from the old one
Creating a new data directory
Need to stop the mysqld service
service mysqld stop
2 step
Create a new data diretory and move the content from the old one
Creating a new data directory
mkdir /DB/mysql/
3 step
Change the owner of the directories
chown mysql:mysql /DB/mysql
4 Step
Moving the original data files
mv /var/lib/mysql/* /BD/mysql/
5 step
Correct the MySQL configuration file, Edit the /etc/my.cnf file iwth your favorite editor
vi /etc/my.cnf
Changedatadir=/var/lib/mysql
todatadir=/DB/mysql
andsocket=/var/lib/mysql/mysql.sock
tosocket=/BD/mysql/mysql.sock
and save the file.5 step
Disable the selinux
setenforce 0
and vi /etc/selinux/config
change the enforcing to disabled and save and exit.
6 step
start the mysql service
service mysqld start
if it shows mysql Deamon not starting then add the following lines to my.cnf file befor mysqld
[client]
socket=/DB/mysql/mysql.sock
7 step
restart the mysqld and try with login
service mysqld restart
mysql -u root -p
All the best......
No comments:
Post a Comment