Bug #74006 date is not generated in secret file with solaris(tar.gz,pkg) installation
Submitted: 22 Sep 2014 6:34 Modified: 1 Jul 2015 15:00
Reporter: Ramana Yeruva Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[22 Sep 2014 6:34] Ramana Yeruva
Description:
install solaris pkg or create database with m_i_db with default or with different password file option and see content of password generated

How to repeat:
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: ls
innochecksum                mysql                       mysql_config                mysqldump                   mysql_secure_installation   mysql_tzinfo_to_sql
myisamchk                   mysqladmin                  mysql_config_editor         mysqldumpslow               mysql_server_config         mysql_upgrade
myisam_ftdump               mysqlbinlog                 mysqld                      mysql_embedded              mysqlshow                   perror
myisamlog                   mysqlcheck                  mysqld-debug                mysqlimport                 mysqlslap                   replace
myisampack                  mysql_client_test           mysqld_multi                mysql_install_db            mysqltest                   resolveip
my_print_defaults           mysql_client_test_embedded  mysqld_safe                 mysql_plugin                mysqltest_embedded          resolve_stack_dump
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: ./mysql_install_db --basedir=../ --datadir=./data57 -v
 08:09:34 [NOTE]    Creating data directory ./data57
 08:09:34 [NOTE]    Generating random password to //.mysql_secret...done.
 08:09:34 [NOTE]    Executing ../bin/mysqld --no-defaults --bootstrap --datadir=./data57 --lc-messages-dir=../share --lc-messages=en_US --basedir=..
 08:09:46 [NOTE]    Creating system tables...done.
 08:09:46 [NOTE]    Filling system tables with data...done.

 08:10:24 [NOTE]    Filling help table with data...done.
 08:10:24 [NOTE]    Creating default user root@localhost
 08:10:24 [NOTE]    Creating default proxy root@localhost
 08:10:32 [NOTE]    Success!
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: 
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: cat //.mysql_secret<--see date is not generated here
# Password set for user 'root@localhost' at  08:09:34 
3_qphqTD%o)t
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: rm -rf //.mysql_secret
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: ./mysql_install_db --basedir=../ --datadir=./data57 -v --random-password-file=/export/home2/tmp/Ramana/secret
 08:14:05 [ERROR]   The data directory './data57' already exist and is not empty.
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: rm -rf data57/
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: ./mysql_install_db --basedir=../ --datadir=./data57 -v --random-password-file=/export/home2/tmp/Ramana/secret<--trying with different password file path
 08:14:12 [NOTE]    Creating data directory ./data57
 08:14:12 [NOTE]    Generating random password to /export/home2/tmp/Ramana/secret...done.
 08:14:12 [NOTE]    Executing ../bin/mysqld --no-defaults --bootstrap --datadir=./data57 --lc-messages-dir=../share --lc-messages=en_US --basedir=..
 08:14:23 [NOTE]    Creating system tables...done.
 08:14:23 [NOTE]    Filling system tables with data...done.
 08:15:05 [NOTE]    Filling help table with data...done.
 08:15:05 [NOTE]    Creating default user root@localhost
 08:15:05 [NOTE]    Creating default proxy root@localhost
 08:15:11 [NOTE]    Success!
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: cat /export/home2/tmp/Ramana/secret<--see date is not generated here
# Password set for user 'root@localhost' at  08:14:12 
ecBg25)V!jb.

[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: ./mysqld -uroot --basedir=../ --datadir=./data57 --gdb &
[1] 21925
[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: 2014-09-22T06:17:33.714529Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-09-22T06:17:33.715357Z 0 [Note] ./mysqld (mysqld 5.7.5-m15) starting as process 21925 ...
2014-09-22T06:17:33.743007Z 0 [Note] Plugin 'FEDERATED' is disabled.
2014-09-22T06:17:33.747347Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-09-22T06:17:33.747506Z 0 [Note] InnoDB: Uses event mutexes
2014-09-22T06:17:33.747645Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2014-09-22T06:17:33.747785Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-09-22T06:17:33.755388Z 0 [Note] InnoDB: Number of pools: 1
2014-09-22T06:17:33.756023Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2014-09-22T06:17:33.759334Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128.0M, instances = 1, chunk size = 128.0M
2014-09-22T06:17:34.013284Z 0 [Note] InnoDB: Completed initialization of buffer pool
2014-09-22T06:17:34.049721Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2014-09-22T06:17:34.147801Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2014-09-22T06:17:34.148779Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2014-09-22T06:17:35.061153Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2014-09-22T06:17:35.070453Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2014-09-22T06:17:35.070616Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2014-09-22T06:17:35.073724Z 0 [Note] InnoDB: Waiting for purge to start
2014-09-22T06:17:35.124226Z 0 [Note] InnoDB: 5.7.5 started; log sequence number 2409964
2014-09-22T06:17:35.127644Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 24c5a0a7-4220-11e4-b762-79e1fc4a7e9c.
2014-09-22T06:17:35.145144Z 0 [Warning] Failed to setup SSL
2014-09-22T06:17:35.145299Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key
2014-09-22T06:17:35.148791Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2014-09-22T06:17:35.149302Z 0 [Note] IPv6 is available.
2014-09-22T06:17:35.149480Z 0 [Note]   - '::' resolves to '::';
2014-09-22T06:17:35.149662Z 0 [Note] Server socket created on IP: '::'.
2014-09-22T06:17:35.232847Z 0 [Note] Event Scheduler: Loaded 0 events
2014-09-22T06:17:35.233138Z 0 [Note] ./mysqld: ready for connections.
Version: '5.7.5-m15'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)

[root@tor09]/export/home2/tmp/Ramana/mysql-5.7.5-m15-solaris10-sparc-64bit-gcc/bin: ./mysql -uroot -p'ecBg25)V!jb.'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.5-m15

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show plugins;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> exit
Bye

Suggested fix:
I see it is generated correctly with new style rpms
[lroot@vitro77 repository_code]# cat /root/.mysql_secret 
# Password set for user 'root@localhost' at 2014-09-22 08:11:54 
B>3!gJc;dM,%
[1 Jul 2015 15:00] Paul Dubois
Noted in 5.7.8 changelog.

mysql_install_db did not write a date to the .mysql_secret file.