Bug #106161 Instructions on Symbolic Links for Databases on Windows are insufficient
Submitted: 13 Jan 2022 17:30 Modified: 2 Feb 2022 23:40
Reporter: Alex Kundzich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:ALL OS:Windows
Assigned to: Jon Stephens CPU Architecture:Any
Tags: documentation

[13 Jan 2022 17:30] Alex Kundzich
Description:
Document 8.12.2.3 Using Symbolic Links for Databases on Windows from MySQL 8.0 Reference Manual has insufficient, if not misleading, instructions
I spent several hours of trials and errors trying to resolve the issue.

How to repeat:
Follow instructions from 8.12.2.3:

Change location into the data directory:
   C:\> cd \path\to\datadir
In the data directory, create a symlink named mydb that points to the location of the database directory:
   C:\> mklink /d mydb D:\data\mydb.

After that: 
  - try to use mydb - you get an error Database doesn't exist;
  - try to Create Database mydb - you get an error File already exists.

Suggested fix:
I suggest instruction should be rewritten as below. Then it would be easy to implement.

On Windows, you can create a symlink using the mklink command. This command requires administrative privileges.

1. Make sure the path to a new database location exist: D:\data\Mydb. 
2. In MySQL, create the Database Mydb.
3. Stop MySQL service.
4. In Windows Explorer, delete an empty folder \path\to\datadir\Mydb.
5. Open Command prompt and go to the data directory:
   C:\> cd \path\to\datadir
6. In the data directory, create a symlink named Mydb that points to the location of the database directory:
   C:\> mklink /d Mydb D:\data\Mydb
7. Start MySQL service.

After this, all tables created in the database mydb are created in D:\data\mydb.
[14 Jan 2022 13:44] MySQL Verification Team
Hi Mr. Kundzich,

Thank you for your documentation bug report.

Verified as reported.
[2 Feb 2022 23:40] Jon Stephens
Hi,

We've updated the material in question with your feedback and some additional input from our Support staff. The changes should appear in the online Manual shortly.

Thanks!
[2 Feb 2022 23:40] Jon Stephens
Fixed in all current versions of the Manual, in mysqldoc rev 71837.

Closed.
[3 Feb 2022 13:22] MySQL Verification Team
Thank you, Jon .....