Bug #77353 Using different to typical installation directory- Binary Linux
Submitted: 15 Jun 2015 6:39 Modified: 23 Aug 2017 12:27
Reporter: Jose Luis Bernal Zambrano Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.7.19 OS:Linux (CentOS 6.6 32bits)
Assigned to: Terje Røsten CPU Architecture:Any
Tags: mysql_install_db mysqld_safe error

[15 Jun 2015 6:39] Jose Luis Bernal Zambrano
Description:
When is performed the installation to another directory, the scripts doesn't work properly:

/usr/local/OtherDir/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/OtherDir/mysql --datadir=/usr/local/OtherDir/mysql/data --log-error=/usr/local/OtherDir/mysql/data/server.err

Trying to start the server with:

/usr/local/OtherDir/mysql/bin/mysqld_safe --user=mysql &
Doesn't work!

/usr/local/OtherDir/mysql/bin/mysqld_safe --user=mysql --basedir=/usr/local/OtherDir/mysql --datadir=/usr/local/OtherDir/mysql/data &
Doesn't work!

Reviewing the Script mysqld_safe (ledir is checked instead of basedir)

/usr/local/OtherDir/mysql/bin/mysqld_safe --user=mysql --ledir=/usr/local/OtherDir/mysql/bin --datadir=/usr/local/OtherDir/mysql/data &

How to repeat:
Try to install using Binary "tar.gz" using https://dev.mysql.com/doc/refman/5.0/en/binary-installation.html

But directory different to: /usr/local/mysql

Suggested fix:
Check verification when the scripts (mysql_install_db or mysqld_safe) catches the arguments name and values...
verify consistence 
Check if your "cp support-files/mysql.server /etc/init.d/mysql.server" verifies when another directory is used!!!
[15 Jun 2015 6:48] Jose Luis Bernal Zambrano
Iniciar el servidor
/usr/local/OtherDir/mysql/bin/mysqld_safe --user=mysql &

//----INI RESULT!!!!----------------------------------------------------
[1] 17727
[root@Fold1]# 150615 00:27:08 mysqld_safe Logging to '/usr/local/OtherDir/mysql/data/server.err'.
150615 00:27:08 mysqld_safe The file /usr/local/mysql/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information

[1]+  Exit 1                  /usr/local/OtherDir/mysql/bin/mysqld_safe --user=mysql
#
//----END RESULT!!!!----------------------------------------------------

Check before comment with "/usr/local/mysql/bin/mysqld" instead of "/usr/local/OtherDir/mysql/bin/mysqld"!!!

How Work?
# /usr/local/OtherDir/mysql/bin/mysqld_safe --user=mysql --ledir=/usr/local/OtherDir/mysql/bin --datadir=/usr/local/OtherDir/mysql/data &

//----INI RESULT!!!!----------------------------------------------------
[2] 18209
[1]   Exit 1                  /usr/local/OtherDir/mysql/bin/mysqld_safe --user=mysql --ledir=/usr/local/OtherDir/mysql --datadir=/usr/local/OtherDir/mysql/data
[root@Fold1]# 150615 00:48:39 mysqld_safe Logging to '/usr/local/OtherDir/mysql/data/server.err'.
150615 00:48:39 mysqld_safe Starting mysqld daemon with databases from /usr/local/OtherDir/mysql/data
[root@Fold1]# 
//----END RESULT!!!!----------------------------------------------------

Check the nameOption "ledir" instead of "basedir"!!!
[23 Aug 2017 12:27] Terje Røsten
I am not able to reproduce with latest release MySQL 5.7.19.