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:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.12 OS:Microsoft Windows (Windows XP/Win2k)
Assigned to: CPU Architecture:Any

[31 Mar 2003 12:53] mark law
Description:
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 "2.6.2.5 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] Miguel Solorzano
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
machine.  
  
In this way the message error you got is originated when
the file access is verified in the routine:  
  
/ sql/sql_db.cpp  
--334--  
bool mysql_change_db (...)  
..........  
if (access(path,F_OK))   
{      
  net_printf(&thd->net,ER_BAD_DB_ERROR,dbname);  
  my_free(dbname,MYF(0));  
  DBUG_RETURN(1);  
 }  

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
resource.