7

I'm running a dual boot server with Windows 7 and Ubuntu. On Ubuntu, everything is configured how I want it. On Windows, I need to know how to change my MySQL database directory so that it uses the same directory I'm using on Ubuntu. How do I do this?

3 Answers 3

23

Hope this image would guide clear. You can write click and select view image to see my answer clearly

Please don't forget to restart wamp/xampp after these steps then it will be applied

Sign up to request clarification or add additional context in comments.

4 Comments

Exactly what I needed. Thanks for taking the time to illustrate it.
If your doing this to recover an old database you'll want to also check out dba.stackexchange.com/questions/163445/… Just make sure you disable recovery after your done!
I have followed these tips but got an error: Failed to find a valid data directory. Do you have any idea how to solve this?
Your given path is not valid or accessible or a typing mistake in path. @arhakim sorry its late, but answer to your issue could not be confirmed without knowing your directory structure and persmissions.
7

1 in WAMP sever 2.2 [ in windows ],

go to C:\wamp\bin\mysql\mysql5.5.24\my.ini

[2] you will find like this,

datadir=c:/wamp/bin/mysql/mysql5.5.24/data

[3] change this with

" datadir = Your Ubuntu MySql Data Directory Path ".

[4] Then restart wamp serever.

i hope this will helpful to solve your problem.

Thanks.

1 Comment

If your doing this to recover an old database you'll want to also check out dba.stackexchange.com/questions/163445/… Just make sure you disable recovery after your done!
-2

i Have better idea ... open phpmyadmin page ... and select you data base ... on the operations tab and in the Rename database to section ... write your new Database name . you will see tow message . press yes button for both

1 Comment

He wasn't asking how to change the database name, he's asking how to re configure the Data folder location.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.