| Bug #84263 | mysql.server (MySQL Server Startup Script) can not work,and export some error. | ||
|---|---|---|---|
| Submitted: | 19 Dec 2016 10:53 | Modified: | 24 Feb 2017 17:48 |
| Reporter: | song boomballa | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Installing | Severity: | S2 (Serious) |
| Version: | 5.7.17 | OS: | CentOS (6.6) |
| Assigned to: | Terje Røsten | CPU Architecture: | Any |
| Tags: | mysql install,error of mysql.server (MySQL Server Startup Script) | ||
[19 Dec 2016 10:53]
song boomballa
[19 Dec 2016 11:03]
song boomballa
2. To initialize shell> ./bin/mysqld --defaults-file=/opt/app/mysql/my.cnf --user=mysql --initialize --basedir=/opt/app/mysql --datadir=/opt/app/mysql/data this is the initialize statement.
[19 Dec 2016 12:29]
MySQL Verification Team
Thank you for the report. Does adding [mysql.server] group to the global conf file(/etc/my.cnf) helps? [mysql.server] basedir=/opt/app/mysql Thanks, Umesh
[19 Dec 2016 18:53]
Terje Røsten
Hi!
Thanks for your report!
It seems mysqld_safe is started with an absolute path in this case ($bindir becomes /opt/app/mysql/bin),
then will mysqld_safe prefer the compiled in absolute path due to:
case "$0" in
/*)
MY_PWD='/usr/local/mysql'
which don't match your basedir of /opt/app/mysql, and it ends up in mismatch.
Can you do the following change:
--- support-files/mysql.server 2016-11-28 16:39:45.000000000 +0100
+++ /etc/init.d/mysql 2016-12-19 19:48:21.341556317 +0100
@@ -275,7 +275,7 @@
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
+ bin/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
# Make lock for RedHat / SuSE
That is changing path to mysqld_safe to a relative path.
Can you please try and see if this change helps?
[20 Dec 2016 2:28]
song boomballa
HI,Umesh: Thank you for your reply. My configuration file my.cnf is placed in / opt / app / mysql directory, I try to add [Mysql.server] Basedir = / opt / app / mysql But the problem already exists, the error message without any change. [root@localhost ~]# vim /opt/app/mysql/my.cnf [root@localhost ~]# /etc/init.d/mysql start Starting MySQL.Logging to '/opt/app/mysql/data/localhost.localdomain.err'. 2016-12-20T10:23:03.923878Z 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 ERROR! The server quit without updating PID file (/opt/app/mysql/tmp/localhost.pid). Above for the error export message.
[20 Dec 2016 3:04]
song boomballa
Hi,Terje Røsten: Thank you for your reply. According to your prompt, mysql.server can be used normally. But this is very inconvenient, if basedir not installed in /usr/local/mysql, you need to manually modify the mysql.server, this is not a very interesting thing, this issue can be modified in the future version of it? Because a lot of users will not necessarily based on /usr/local/mysql basedir. I really hope that the future version of mysql can be improved for this issue.
[25 Dec 2016 4:12]
MySQL Verification Team
also; http://bugs.mysql.com/bug.php?id=84173
[25 Dec 2016 10:26]
Terje Røsten
> This issue can be modified in the future version of it? We hope to include a fix in the next release.
[24 Feb 2017 17:48]
Paul DuBois
Posted by developer: Noted in 5.5.55, 5.6.36, 5.7.18, 8.0.1 changelogs. A recent change to mysqld_safe caused the mysql.server script to be unable to start it if the base directory was specified as an absolute path that differed from the compiled-in default absolute path.
[12 Apr 2017 13:19]
MySQL Verification Team
Bug #85901 marked as duplicate of this one
