Bug #82764 [Regression] MySQL server corrupts install if mysql user exists in FreeBSD
Submitted: 28 Aug 2016 14:02 Modified: 24 Nov 2017 14:48
Reporter: Marcelo Ruiz Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.17 OS:FreeBSD
Assigned to: CPU Architecture:Any
Tags: mysql-server freebsd

[28 Aug 2016 14:02] Marcelo Ruiz
Description:
MySQL server installs if mysql user exits and logs that it is using both the existing mysql group and user, but it sets wrong folder ownership to the database folder (it uses user and group '88' which is the user and group it would use if no mysql user exists in the system).
Even after correcting those errors, mysql server would fail to start.
Installation goes well if no mysql user and group exists in the system.

root@test:/ # cat /root/.mysql_secret                                           
cat: /root/.mysql_secret: No such file or directory 

root@test:/var/db # cat /home/mysql/.mysql_secret                               
cat: /home/mysql/.mysql_secret: No such file or directory  

root@test:/var/db # ls -l                                                       
total 40                                                                        
----------  1 root      wheel      1140 Aug 28 09:26 dhclient.leases.epair0b    
drwx------  2 operator  operator      2 Mar 24 22:10 entropy                    
drwxr-xr-x  3 root      wheel         4 Mar 24 22:11 etcupdate                  
drwx------  2 root      wheel         2 Mar 24 22:10 freebsd-update             
drwx------  2 root      wheel         2 Mar 24 22:10 hyperv                     
drwx------  2 root      wheel         2 Mar 24 22:10 ipf                        
-rw-r--r--  1 nobody    wheel         0 Mar 24 22:11 locate.database            
-rw-------  1 root      wheel     28635 Mar 24 22:11 mergemaster.mtree          
drwxr-xr-x  2 88        88            2 Aug 28 09:32 mysql                      
drwxr-x---  2 root      mysql         2 Aug 16 15:04 mysql_secure               
drwxr-x---  2 root      mysql         2 Aug 16 15:04 mysql_tmpdir               
drwx------  2 root      wheel         2 Mar 24 22:10 ntp                        
drwxr-xr-x  9 root      wheel        10 Aug 27 16:54 pbi                        
drwxr-xr-x  2 root      wheel         5 Aug 28 09:33 pkg                        
drwxr-xr-x  2 root      wheel         2 Mar 24 22:10 ports                      
drwxr-xr-x  2 root      wheel         2 Mar 24 22:10 portsnap                 

After adding 'mysql_enable="YES"' to /etc/rc.conf, it is impossible to start the server:

service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql

Following suggested steps to fix "WARNING: failed precmd routine for mysql" does not fix the issue.

How to repeat:
Create a new Jail in FreeBSD 10.
Add user mysql and assign it to group wheel.
Change to root user.
Install with 'pkg install mysql57-server'
add mysql_enable="YES" to /etc/rc.conf
Try to start mysql-server
[24 Nov 2017 14:37] MySQL Verification Team
Hi!

Thank you for your report.

Can you please let us know which FreeBSD version and release are you having problem with, as described in this bug report ??
[24 Nov 2017 14:48] MySQL Verification Team
Hi!,

Actually, as it turns out, we provide only tarballs for FreeBSD. We do not provide packages.

That means that you have probably downloaded a package from FreeBSD ports. Since we are not building those, we can not help you with packages that are not built by us.