Bug #87226 | mysqld_safe will force-set DATADIR to /usr/data and | ||
---|---|---|---|
Submitted: | 27 Jul 2017 17:10 | Modified: | 25 Sep 2017 13:06 |
Reporter: | Brian Fujito | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S3 (Non-critical) |
Version: | 5.6.37-1ubuntu14.04 | OS: | Ubuntu (trusty 14.04.5 LTS) |
Assigned to: | MySQL Verification Team | CPU Architecture: | Any |
[27 Jul 2017 17:10]
Brian Fujito
[27 Jul 2017 19:50]
Brian Fujito
I have also found that /usr/bin/mysql_install_db now set to default to /usr/data: ****** unless ( $opt->{ldata} ) { $opt->{ldata} = '/usr/data'; } ****** Since the /etc/init.d/mysql calls on mysql_install_db and mysqld_safe without passing a datadir option, we get stuck using defaults. In the case of mysqld_safe, even if we were to change /etc/init.d/mysql to specify a datadir, it will get ignored and overwritten as shown in my original post.
[27 Jul 2017 19:57]
Brian Fujito
Sorry -- to clarify my latest comment... On the latest MySQL 5.6.37, the call to mysql_install_db is actually in the new file: /usr/share/mysql/mysql-helpers I would argue that in there, in the "verify_database()" function, we should be calling su - mysql -s /bin/bash -c "mysql_install_db --user=mysql --datadir=$MYSQLDATA > /dev/null"
[28 Jul 2017 17:43]
Brian Fujito
The most straight-forward changes would be to set the defaults to /var/lib/mysql: sed -i "s;/usr/data;/var/lib/mysql;g" /usr/bin/mysql_install_db sed -i "s;DATADIR=/usr/data;DATADIR=/var/lib/mysql;" /usr/bin/mysqld_safe Thanks, Brian
[25 Aug 2017 13:06]
MySQL Verification Team
Hi, The workaround you mentioned (change defaults) will work. Now I have to ask, what binaries are you using? How did you install mysql 5.6 on that ubuntu14 all best Bogdan
[26 Sep 2017 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".