Solved

how to change the data directory for nysql

Posted on 2010-09-01
8
483 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

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