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
Solved

how to change the data directory for nysql

Posted on 2010-09-01
8
481 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
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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