Solved

how to change the data directory for nysql

Posted on 2010-09-01
8
482 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 12

Accepted Solution

by:
mcv22 earned 167 total points
ID: 33580112
0
 
LVL 9

Assisted Solution

by:shalabhsharma
shalabhsharma earned 333 total points
ID: 33585209
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
ID: 33585298
sorry.. my earlier reply for windows OS for here below for you

http://www.bsdguides.org/guides/freebsd/databases/mysql_database_location.php
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:shangyhi2000
ID: 33586064
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
 
LVL 19

Expert Comment

by:jools
ID: 33590718
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
ID: 33595558
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
ID: 33596364
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
ID: 33602784
jools,
can you please explain more what is your question
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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