Change MySQL Data directory

Dinal Peiris
Jan 1, 2021

--

This article is about changing the data directory of MySQL server in windows based installation

  1. First step is to find the MySQL configuration file(my.ini) location. To achieve open services window and find the MySQL service then right click and go to the properties. From properties window get location of my.ini file
Finding location of my.ini file

2. Stop MySQL service and open my.ini using text editor like notepad or notepad++ find the location of “datadir” and change the path to new location

datadir location in my.ini file

Note: Sometimes administrator privilege required to edit my.ini file
3.Start my SQL service again. Now ready to go with new datadir.

--

--

Dinal Peiris
Dinal Peiris

No responses yet