Bug #70537 No users created under MySQL system database for RPM based installation
Submitted: 6 Oct 2013 19:28 Modified: 17 Feb 2014 19:41
Reporter: Muhammad Irfan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5.33 OS:Linux
Assigned to: Paul DuBois CPU Architecture:Any

[6 Oct 2013 19:28] Muhammad Irfan
Description:
When i create data directory manually (/var/lib/mysql) for RPM based installation, no default user created under system database mysql while if i delete /var/lib/mysql directory before installation all works as expected. This occurs on CentOS 5.9 with generic/rhel5 rpms.

How to repeat:
rpm -ivh MySQL-client-5.5.33-1.linux2.6.x86_64.rpm MySQL-devel-5.5.33-1.linux2.6.x86_64.rpm MySQL-embedded-5.5.33-1.linux2.6.x86_64.rpm MySQL-server-5.5.33-1.linux2.6.x86_64.rpm MySQL-shared-5.5.33-1.linux2.6.x86_64.rpm MySQL-shared-compat-5.5.33-1.linux2.6.x86_64.rpm MySQL-test-5.5.33-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [ 14%]
   2:MySQL-devel            ########################################### [ 29%]
   3:MySQL-embedded         ########################################### [ 43%]
   4:MySQL-server           ########################################### [ 57%]
   5:MySQL-shared           ########################################### [ 71%]
   6:MySQL-shared-compat    ########################################### [ 86%]
   7:MySQL-test             ########################################### [100%]

[root@centos59 oracle]# rpm -qa | grep -i mysql
MySQL-client-5.5.33-1.linux2.6
MySQL-shared-5.5.33-1.linux2.6
MySQL-devel-5.5.33-1.linux2.6
MySQL-server-5.5.33-1.linux2.6
perl-DBD-MySQL-3.0007-2.el5
MySQL-shared-compat-5.5.33-1.linux2.6
MySQL-embedded-5.5.33-1.linux2.6
MySQL-test-5.5.33-1.linux2.6

[root@centos59 oracle]# ps -ef | grep mysql
root      6641  2828  0 14:15 pts/0    00:00:00 grep mysql

[root@centos59 oracle]# ls -la /var/lib/mysql/mysql
total 8
drwx--x--x 2 mysql mysql 4096 Oct  4 01:52 .
drwxr-xr-x 4 mysql mysql 4096 Oct  4 02:04 ..

[root@centos59 mysql]# ps -ef | grep mysql
mysql     6647  2828  3 14:15 pts/0    00:00:00 /usr/sbin/mysqld --skip-grant-tables --user=mysql

[root@centos59 mysql]# ls -la /var/lib/mysql/mysql/
total 0

* Executed mysql_upgrade
[root@centos59 mysql]# /usr/bin/mysql_upgrade
Looking for 'mysql' as: /usr/bin/mysql
Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Running 'mysqlcheck with default connection arguments
Running 'mysqlcheck with default connection arguments
Running 'mysql_fix_privilege_tables'...
OK

* All necessaary MySQL system tables created but no default users created under MySQL system database.
-rw-rw---- 1 mysql mysql  9510 Oct  4 02:04 host.frm
-rw-rw---- 1 mysql mysql     0 Oct  4 02:04 host.MYD
-rw-rw---- 1 mysql mysql  2048 Oct  4 02:04 host.MYI
-rw-rw---- 1 mysql mysql 10630 Oct  4 02:04 user.frm
-rw-rw---- 1 mysql mysql     0 Oct  4 02:04 user.MYD
-rw-rw---- 1 mysql mysql  1024 Oct  4 02:04 user.MYI

mysql> select user,host from mysql.user;
Empty set (0.00 sec)
[10 Oct 2013 18:36] Sveta Smirnova
Thank you for the report.

I believe this happens to prevent existent data from the modification. But our manual does not mention it at http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html Therefore I mark this report as a verified documentation request.
[17 Feb 2014 19:41] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Added to Linux RPM section:

If the data directory exists at RPM installation time, the 
installation process does not modify existing data. This has the 
effect, for example, that accounts in the grant tables are not
initialized to the default set of accounts.