Bug #214 Symbolic Links on Windows XP Pro Fail when installed as service
Submitted: 31 Mar 2003 12:53 Modified: 2 Apr 2003 2:12
Reporter: mark law Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.12 OS:Windows (Windows XP/Win2k)
Assigned to: CPU Architecture:Any

[31 Mar 2003 12:53] mark law
Symbolic links only work when mysql is started from the command line as follows:
mysqld-max-nt -s             <or>
mysqld-max -s

After installing either of these are a service, symbolic links to another file system fail.
Attempting to start the service manuall with an option of '-s' also fails to allow access to the database.

The specific error is: '1049 - Unkonwn database test'

How to repeat:
1. create *.sym and directory entries per section " Splitting Data Across Different Disks on Windows"
2. install server per directives:
   mysqld-max-nt --install
3. start service
   net start mysql
4. start mysql
   \u test
   ERROR 1049: Unknown database 'test'
5. net stop mysql
6. mysqld-max-nt -s
   start mysql
   \u test
   Database changed
[31 Mar 2003 13:02] mark law
Important NOTE:
The symbolic links only appear to fail when the drive is remote. i.e. H:\data\test where the H:\ drive is a mapped drive on a Windows File Server.
A symbolic link on a local drive appears to work under all conditions.
[2 Apr 2003 2:12] MySQL Verification Team
The mysql service is installed as Local System account
and by default Local System service can't access shared
directories, or files on another machine because the
Local System account can't be authenticated on the remote
In this way the message error you got is originated when
the file access is verified in the routine:  
/ sql/sql_db.cpp  
bool mysql_change_db (...)  
if (access(path,F_OK))   

However is possible to use the symbolic link with mapped
drivers and the server started as service. For to make
this possible you need to change the Local System account
by an User Account through the Service Control Manager
where you specify the name and password, and taking the
care that this user have granted access to the network