• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 489
  • Last Modified:

how to change the data directory for nysql

hi all,
i have a situation where i need to change the data root for mysql to another directory
can you please help me to do so
thanks in advance
shangyhi2000
0
shangyhi2000
Asked:
shangyhi2000
  • 3
  • 2
  • 2
  • +1
3 Solutions
 
shalabhsharmaCommented:
stop the MySQL service copy the data directory to new location.then in MY.ini change the path of data directory location

you can find my.ini in mysql installation folder

i.e change the data dir path

#Path to the database root
datadir="C:/MySQL/Data/"

to

#Path to the database root
datadir="D:/MySQL/Data/"

save it

restart mysql service.

Thats it.
0
 
shalabhsharmaCommented:
sorry.. my earlier reply for windows OS for here below for you

http://www.bsdguides.org/guides/freebsd/databases/mysql_database_location.php
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
shangyhi2000Author Commented:
dear shalabhsharma,mcv22,
i'm using centos 5.4 the configuration file is /etc/my.cnf
after i do so mysql service restart normally but phpmyadmin does not work i don't know why i've installed it using yum
can you help in that
0
 
joolsCommented:
Strange, I wouldnt have thought phpmyadmin needed access to the db files...

Does mysql start ok after the move?
Can you login locally?
What error do you get when phpmyadmin starts?
0
 
shangyhi2000Author Commented:
Does mysql start ok after the move? yes
Can you login locally? no
What error do you get when phpmyadmin starts?can't access db
0
 
joolsCommented:
are you using the correct user credentials and is the login you are using configured to allow access from the host you are coming from?
0
 
shangyhi2000Author Commented:
jools,
can you please explain more what is your question
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now