How to change MYSQL database data directory to another location? - WAMP andrey четверг, 8 мая 2014 г. No Comment

Database server storing the values in files data directory. So, if you want to change the storage location for the database, you can just put this data directory in any location in your system and tell that path to MYSQL to manipulate data.

In this post I'm going to show some screen shots to do this.

Note : I'm using WAMP in this example.


  • First step you should Stop All services
  • Just click on the WAMP icon, then select MySQL, then select my.ini file like the above image
  • After open you my.ini y.ini in your editor(notepad), find the word datadir. Here you can see the file path for data directory.
  • datadir=c:/wamp/bin/mysql/mysql5.5.24/data is current file path for data directory.
  • Just go and cut that data directory from the current place and paste it to your desired location.
  • Then replace your current directory path to your data directory.
  • For example, I pasted my data directory E:/CJ_Ramki/data. So, I changed that directory path to datadir=E:/CJ_Ramki/data like below picture.
  •  Finally Start All Services
That's it... Your database server will write and read files from you new location.
Database server storing the values in files data directory. So, if you want to change the storage location for the database, you can just put this data directory in any location in your system and tell that path to MYSQL to manipulate data.

In this post I'm going to show some screen shots to do this.

Note : I'm using WAMP in this example.


  • First step you should Stop All services
  • Just click on the WAMP icon, then select MySQL, then select my.ini file like the above image
  • After open you my.ini y.ini in your editor(notepad), find the word datadir. Here you can see the file path for data directory.
  • datadir=c:/wamp/bin/mysql/mysql5.5.24/data is current file path for data directory.
  • Just go and cut that data directory from the current place and paste it to your desired location.
  • Then replace your current directory path to your data directory.
  • For example, I pasted my data directory E:/CJ_Ramki/data. So, I changed that directory path to datadir=E:/CJ_Ramki/data like below picture.
  •  Finally Start All Services
That's it... Your database server will write and read files from you new location.
by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment