Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 3728  / 1 Year ago, wed, april 26, 2023, 10:28:17

If I start MYSQL cluster server with this command I get an error:



root@v-server1:/usr/local/mysql-cluster# /etc/init.d/mysql.server start
Starting MySQL
The server quit without updating PID file (/var/lib/mysql/v-server1.pid).
root@v-server1:/usr/local/mysql-cluster#


But if I start via this command the server starts without problems:



root@v-server1:/usr/local# cd mysql-cluster

root@v-server1:/usr/local/mysql-cluster# bin/mysqld_safe --defaults-extra-file=/etc/mysqld-cluster.cf --user=mysql --datadir=/var/lib/mysql --basedir=/usr/local/mysql-cluster &
[1] 29119

120404 13:44:00 mysqld_safe Logging to '/var/log/mysql/error.log'.
120404 13:44:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
^C
root@v-server1:/usr/local/mysql-cluster# /etc/init.d/mysql.server status
MySQL running (29524)


My problem is that I want to have the server started automatically when I switch on the system.


More From » startup

 Answers
7

Find your error by checking var/log/syslog after booting or running the /etc/init.d/ script. There should be a lot of helpful information there.



My guess is that there is a problem with the command arguments or environment that the startup script is using for the start on bootup.



Another way to get things to work is to edit the startup script to give it the exact command and arguments you used when you started it successfully.



If your startup is happening from /etc/init.d/mysql.server, check that file.



On my system, mysql is started using upstart, so the file in /etc/init.d/ is only a link to the generic /lib/init/upstart-job/ script.



To do a test, I can move the variables from the successful startup command, /usr/bin/mysqld_safe --defaults-extra-file=/etc/mysqld-cluster.cf --user=mysql --datadir=/var/lib/mysql --basedir=/usr/local/mysql-cluster, into one of the config files.



On my system, these are my other configuration files:



/etc$ ls -lR mysql/
mysql/:
total 16
drwxr-xr-x 2 root root 4096 May 3 18:53 conf.d
-rw------- 1 root root 333 May 3 18:53 debian.cnf
-rwxr-xr-x 1 root root 1220 Mar 29 23:48 debian-start
-rw-r--r-- 1 root root 3504 Feb 17 16:41 my.cnf

mysql/conf.d:
total 4
-rw-r--r-- 1 root root 21 Mar 29 23:47 mysqld_safe_syslog.cnf


Many default values are found here. You'll notice a lot of familiar-looking environment variables in your config files (such as debian-start and my.cnf).



You will eventually want to track down defaults that are being provided from the configuration in your /etc directory. For example, see if you have files in places like /etc/mysql and /etc/default/mysql or even something like /etc/mysql.conf.



After making changes, test to see if you have replicated the working manual start-up. On my system, I can test the mysql server set-up with sudo service mysql start .


[#39484] Thursday, April 27, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
farnic

Total Points: 409
Total Questions: 117
Total Answers: 125

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
;