Bug #60384 mysql_install_db.pl didn't fill system tables!
Submitted: 8 Mar 2011 7:48 Modified: 2 Dec 2016 13:21
Reporter: Sun ChangMing Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5-bzr, 5.6-bzr OS:Windows
Assigned to: CPU Architecture:Any

[8 Mar 2011 7:48] Sun ChangMing
Description:
In Linux, the default MySQL grant tables can be created with the mysql_install_db script, but that does not work on Windows.

At the line 343-345 of mysql_install_db.pl.in , it defined 3 variables,

my $fill_help_tables     = "$pkgdatadir/fill_help_tables.sql";
my $create_system_tables = "$pkgdatadir/mysql_system_tables.sql";
my $fill_system_tables   = "$pkgdatadir/mysql_system_tables_data.sql";

But the 2nd and the 3rd one have not been referenced, why ?

How to repeat:
1. Build mysql 5.5.9 from source
2. execute script/mysql_install_db.pl 
3. start the server
4. try to login .

I got the error of 
"ERROR 1045 (28000): Access denied for user 'root'@'::1' (using password: NO)"
[8 Mar 2011 12:57] Santo Leto
Hi,

On Windows you don't need to use that script, nor to create MySQL grant tables manually (they are created automatically).

Typically you execute the following commands:

1. cmake -DBUILD_CONFIG=mysql_release -G "Visual Studio 10"
2. if you want to create the archive use command:

vcexpress MySql.sln /build RelWithDebInfo /project package

if you want to create the installer, you can use the following command instead:

vcexpress MySql.sln /build RelWithDebInfo /project msi 

(you can use devenv instead of vcexpress, it depends on your Visual Studio Edition).

The archive is created in the root directory. The installer is located on the packaging\WiX directory.

Once you have the archive package, copy it in a folder and unzip it. Then start the server as usual.

If you want to use the installer, just double click on the msi file. Please note that msi built in this way lacks the Configuration Wizard so be prepared to have the windows installer without the MySQL Configuration Wizard.

I suggest you to creat the archive - it is more flexible.
[8 Mar 2011 13:06] Sun ChangMing
If we  don't need it, why not remove it from source tree ? 
At least , it should not be installed when I execute "nmake install" .
[9 Mar 2011 9:35] Santo Leto
Thank you for the feedback.
 
I see that we have some files in the script directory:

- mysql_secure_installation.pl
- mysql_install_db.pl
- and couple more

If those files are nor required for compilation in Windows, and they are not used by any other file, I agree with you they should be removed.
[2 Dec 2016 13:21] Terje Røsten
Posted by developer:
 
mysql_install_db is now obsolete after:

commit 0b5c2e7b7a382a9a37a4dd36cbf49fb929e3d6fe
Author: Georgi Kodinov <georgi.kodinov@oracle.com>
Date:   Tue Jan 27 12:27:05 2015 +0200

    WL#7307: Fold mysql_install_db into the server binary
    
    Implemented as per the worklog spec.
     - added an --initialize option that bootstraps the server
     - added an --initialize-insecure option to prevent random password for the root user
     - added a deprecation warning to --bootstrap and m_i_db
     - Changed sql/CMakeLists.txt to use the new initialization
     - added unit and regression tests