MySQL Installed on D Drive(mysql装D盘)
Recently, I installed MySQL 8.0.21 on my local (Windows) computer, but when it came to choosing the installation directory, I decided to install it on the D drive. That was a challenge because of the errors saying that MySQL cannot be installed on a non-system disk. After almost 3 hours of continuous effort, I was able to successfully install it.
In this blog, I would like to share the approach I used to install MySQL on the D drive, which I believe could prove helpful for others facing a similar challenge.
Installing on a non-system disk is challenging, but fortunately there are some workarounds. The first thing I did was to create a folder on the D drive and set the installation path to that folder.
Next, I configured the registry settings to make the changes permanent to the registry path so that Windows would recognize the path chosen by me. I backed up the registry settings before making changes, which proved to be a wise decision.
Then, I edited the my.ini (configuration) file located in the MySQL installation directory. I added the “basedir” key to point to the newly created folder. This allows the MySQL database to locate its correct path.
I then restarted the MySQL service by using the command “net stop mysql” followed by the command “net start mysql”. Finally, I was able to access the database after running the command “mysql”.
Interestingly, the need to install MySQL on a non-system disk arises when the user wants to store large amounts of data due to the disk space limitation of a particular disk. Moreover, it provides the user better control over their data as they can manage it more easily.
In conclusion, being able to install MySQL on a non-system disk is a difficult task but can be done with a little effort. By carefully following the steps outlined in this blog post, you should be able to successfully install it. Good luck!