Bug #80850 Weird file names on Win10
Submitted: 24 Mar 2016 13:45 Modified: 12 Aug 2016 10:49
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version: OS:Windows (10 Pro 64 bit)
Assigned to: CPU Architecture:Any

[24 Mar 2016 13:45] Peter Laursen
Description:
My Windows "computer name" is "SH_WIN10"

The .pid file use this, but log files use a mystical id "DESKTOP-TE0VNHB" in their names instead.

This was not the case on Win7.

How to repeat:
C:\ProgramData\MySQL\MySQL Server 5.7\Data>dir
 Volume in drive C is Win10
 Volume Serial Number is 0805-A57A

 Directory of C:\ProgramData\MySQL\MySQL Server 5.7\Data

24-03-2016  14:32    <DIR>          .
24-03-2016  14:32    <DIR>          ..
04-12-2015  03:55                56 auto.cnf
24-03-2016  14:32               201 DESKTOP-TE0VNHB-slow.log
24-03-2016  14:32             3.499 DESKTOP-TE0VNHB.err
24-03-2016  14:32        12.582.912 ibdata1
24-03-2016  14:32        12.582.912 ibtmp1
24-03-2016  14:27               425 ib_buffer_pool
24-03-2016  14:32        50.331.648 ib_logfile0
04-12-2015  03:55        50.331.648 ib_logfile1
07-02-2016  11:15    <DIR>          mysql
07-02-2016  11:15                 6 mysql_upgrade_info
07-02-2016  11:15    <DIR>          performance_schema
11-03-2016  14:43    <DIR>          pltest
24-03-2016  14:32                 4 SH-WIN10.pid
25-01-2016  14:16    <DIR>          source
04-12-2015  03:56    <DIR>          sys
25-01-2016  14:17    <DIR>          target
              10 File(s)    125.833.311 bytes
               8 Dir(s)  45.743.783.936 bytes free

C:\ProgramData\MySQL\MySQL Server 5.7\Data>

Suggested fix:
As the .pid file can be named properly, the log files also should be.
[24 Mar 2016 13:46] Peter Laursen
BTW .. this is the same with MySQL 5.5, 5.6 and 5.7 (current GA version of each).
[24 Mar 2016 13:48] Peter Laursen
And same with MariaDB 10.1 BTW.
[24 Mar 2016 13:55] Peter Laursen
On Win 7 the "computer name is "PETER-PC" and this is used consistently in file names (I have a Win7/Win10 dual boot setup on this machine.  The current system partition is always C: and the partion containing the other system is W:). 

W:\ProgramData\MySQL\MySQL Server 5.7\data>dir
 Volume in drive W is Win7
 Volume Serial Number is CA62-D86E

 Directory of W:\ProgramData\MySQL\MySQL Server 5.7\data

15-03-2016  15:29    <DIR>          .
15-03-2016  15:29    <DIR>          ..
01-06-2014  20:28                56 auto.cnf
15-03-2016  15:29        12.582.912 ibdata1
15-03-2016  15:29               550 ib_buffer_pool
15-03-2016  15:29        50.331.648 ib_logfile0
27-11-2015  23:34        50.331.648 ib_logfile1
08-12-2015  22:28    <DIR>          mysql
08-12-2015  22:28                 6 mysql_upgrade_info
08-12-2015  22:28    <DIR>          performance_schema
15-03-2016  15:28             6.100 PETER-PC-slow.log
15-03-2016  15:29           234.217 PETER-PC.err
27-11-2015  23:34    <DIR>          sys
21-03-2015  17:19    <DIR>          test
               8 File(s)    113.487.137 bytes
               6 Dir(s)   7.722.438.656 bytes free

W:\ProgramData\MySQL\MySQL Server 5.7\data>
[24 Mar 2016 14:41] MySQL Verification Team
Non-standard computer name

Attachment: computer_name.png (image/png, text), 22.80 KiB.

[24 Mar 2016 14:42] MySQL Verification Team
Thank you for the bug report. Please see prior attached screen-shot about the computer name warning dialog. Thanks.
[24 Mar 2016 14:56] Peter Laursen
I necer had such error dialog.  Where do you get it/did you copy it from??
[24 Mar 2016 15:00] Peter Laursen
Sorry, the "computer name is ""SH-WIN10" -  not "SH_WIN10".

Attaching Windows "advanced system properties" dialog in net reply
[24 Mar 2016 15:01] Peter Laursen
"advanced system properties" dialog

Attachment: sysproperties.PNG (image/png, text), 19.12 KiB.

[24 Mar 2016 15:59] Peter Laursen
With hindsight, I may have installed the MySQL servers before setting the hostname and workgroup name. The hostname used for naming log filess may have been auto-designated by Windows during Windows installation. 

So I think the culprit of the discussion is: what will happen if 
1) you install MySQL on computer named "oldname"
2) change the hostname of this computer from "oldname" to "newname"
3) restart MySQL

Will it 1) continue to use the existing oldname***.log|err files or will it  2) start logging to new files using the new hostname in file names?
[26 Mar 2016 2:37] MySQL Verification Team
I couldn't repeat with the following scenario:

1- The MySQL server already installed with older computer name URALBR
2- The installer created the my.ini file using the URALBR name:
   general_log_file="URALBR.log"; slow_query_log_file="URALBR-slow.log"
   etc.
3- Removed these names commenting the my.ini file
4- Renamed the computer name to SH-WIN10
5- Restarted computer
6- The files printed are:

C:\ProgramData\MySQL\MySQL Server 5.7\Data>dir
 Volume in drive C has no label.
 Volume Serial Number is 0C1C-80A8

 Directory of C:\ProgramData\MySQL\MySQL Server 5.7\Data

25/03/2016  23:24    <DIR>          .
25/03/2016  23:24    <DIR>          ..
07/03/2016  07:19                56 auto.cnf
25/03/2016  23:24        12.582.912 ibdata1
25/03/2016  23:24        12.582.912 ibtmp1
25/03/2016  23:23               384 ib_buffer_pool
25/03/2016  23:24        50.331.648 ib_logfile0
07/03/2016  07:19        50.331.648 ib_logfile1
15/03/2016  21:27    <DIR>          mysql
15/03/2016  21:27                 6 mysql_upgrade_info
15/03/2016  21:27    <DIR>          performance_schema
25/03/2016  23:24                 0 SH-WIN10-slow.log
25/03/2016  23:24                 1 SH-WIN10.err
25/03/2016  23:24                 6 SH-WIN10.pid
07/03/2016  07:20    <DIR>          sys
15/03/2016  21:29    <DIR>          test
              10 File(s)    125.829.573 bytes
               6 Dir(s)  307.887.026.176 bytes free

How you can see no problems with names. So I need precise steps to repeat.
Thanks.
[26 Mar 2016 9:43] Peter Laursen
I wish I could explain this.  

It is not a problem for me at all and I ony noticed by accidence a few days ago. And I don't have the slightest clue about what the hostname "DESKTOP-TE0VNHB" represents and how and when it was 'picked up' by MySQL.
[12 Aug 2016 10:49] MySQL Verification Team
Thank you for the feedback. I wasn't able to repeat.