Solved

how to change the data directory for nysql

Posted on 2010-09-01
8
475 Views
Last Modified: 2013-11-08
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
Comment
Question by:shangyhi2000
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 12

Accepted Solution

by:
mcv22 earned 167 total points
Comment Utility
0
 
LVL 9

Assisted Solution

by:shalabhsharma
shalabhsharma earned 333 total points
Comment Utility
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
 
LVL 9

Assisted Solution

by:shalabhsharma
shalabhsharma earned 333 total points
Comment Utility
sorry.. my earlier reply for windows OS for here below for you

http://www.bsdguides.org/guides/freebsd/databases/mysql_database_location.php
0
 

Author Comment

by:shangyhi2000
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 19

Expert Comment

by:jools
Comment Utility
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
 

Author Comment

by:shangyhi2000
Comment Utility
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
 
LVL 19

Expert Comment

by:jools
Comment Utility
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
 

Author Comment

by:shangyhi2000
Comment Utility
jools,
can you please explain more what is your question
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now