Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

How to launch mysql at startup ?

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Post Reply
  • Print view
Advanced search
8 posts • Page 1 of 1
Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
How to launch mysql at startup ?
  • Quote

Post by Spheerys » Wed Dec 30, 2015 12:37 pm

My MySQL/Percona server don't want to start at boot.

I always have to launch it manually with a :

Code: Select all

systemctl start mysql
If I do a :

Code: Select all

systemctl enable mysql
I have this result :

Code: Select all

Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d mysql enable
But after a reboot, mysql is stopped :

Code: Select all

~  systemctl status mysql -l
● mysql.service - LSB: Start and stop the mysql (Percona Server) daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: failed (Result: timeout) since mer. 2015-12-30 13:31:59 CET; 1min 16s ago
  Process: 1402 ExecStart=/etc/init.d/mysql start (code=killed, signal=TERM)

déc. 30 13:26:59 danya.domain.net systemd[1]: Starting LSB: Start and stop the mysql (Percona Server) daemon...
déc. 30 13:31:59 danya.domain.net systemd[1]: mysql.service start operation timed out. Terminating.
déc. 30 13:31:59 danya.domain.net systemd[1]: Failed to start LSB: Start and stop the mysql (Percona Server) daemon.
déc. 30 13:31:59 danya.domain.net systemd[1]: Unit mysql.service entered failed state.
déc. 30 13:32:00 danya.domain.net mysql[1402]: Starting MySQL (Percona Server) database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's wrong ?
Top

Elizine
Posts: 50
Joined: Wed Aug 12, 2015 12:11 pm
Contact:
Contact Elizine
Website

Re: How to launch mysql at startup ?
  • Quote

Post by Elizine » Sat Jan 02, 2016 11:26 am

Try the below command -

Code: Select all

sudo update-rc.d mysql defaults
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to launch mysql at startup ?
  • Quote

Post by Spheerys » Sat Jan 02, 2016 8:57 pm

I tried, but after reboot mysql is not running correctly (but something changed) :
~  systemctl status mysql -l
● mysql.service - LSB: Start and stop the mysql (Percona Server) daemon
Loaded: loaded (/etc/init.d/mysql)
Active: activating (start) since sam. 2016-01-02 21:55:06 CET; 2m57s ago
Control: 1407 (mysql)
CGroup: /system.slice/mysql.service
├─1407 /bin/bash /etc/init.d/mysql start
└─2836 sleep 1

janv. 02 21:55:06 subdomain.domain.net systemd[1]: Starting LSB: Start and stop the mysql (Percona Server) daemon...
The process looks sleeping...

For information, a "systemctl start mysql" doesn't works.
I had to make a "systemctl restart mysql" to launch correctly mysql after reboot.
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to launch mysql at startup ?
  • Quote

Post by Spheerys » Wed Jan 06, 2016 3:11 pm

No idea ?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: How to launch mysql at startup ?
  • Quote

Post by skurudo » Thu Jan 07, 2016 11:19 pm

After installing the MySQL server package, you can check to see whether mysqld is enabled or not, this way:

Code: Select all

$ systemctl is-enabled mysqld
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to launch mysql at startup ?
  • Quote

Post by Spheerys » Fri Jan 08, 2016 6:59 am

~  systemctl is-enabled mysqld
Failed to get unit file state for mysqld.service: No such file or directory
or
~  systemctl is-enabled mysql.service
Failed to get unit file state for mysql.service: No such file or directory
But is was started manually :
~  systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql (Percona Server) daemon
Loaded: loaded (/etc/init.d/mysql)
Active: active (running) since sam. 2016-01-02 22:05:04 CET; 5 days ago
CGroup: /system.slice/mysql.service
├─6942 /bin/sh /usr/bin/mysqld_safe
└─7372 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306

janv. 02 22:05:04 danya.server.net mysql[6906]: Starting MySQL (Percona Server) database server: mysqld.
janv. 02 22:05:04 danya.server.net mysql[6906]: Checking for corrupt, not cleanly closed and upgrade needing tables..
janv. 02 22:05:04 danya.server.net systemd[1]: Started LSB: Start and stop the mysql (Percona Server) daemon.
janv. 02 22:05:04 danya.server.net /etc/mysql/debian-start[7434]: Upgrading MySQL tables if necessary.
janv. 02 22:05:04 danya.server.net /etc/mysql/debian-start[7437]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
janv. 02 22:05:04 danya.server.net /etc/mysql/debian-start[7437]: Looking for 'mysql' as: /usr/bin/mysql
janv. 02 22:05:04 danya.server.net /etc/mysql/debian-start[7437]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
janv. 02 22:05:04 danya.server.net /etc/mysql/debian-start[7437]: This installation of MySQL is already upgraded to 5.5.46-37.6, use --force if you still need to run mysql_upgrade
janv. 02 22:05:04 danya.server.net /etc/mysql/debian-start[7456]: Checking for insecure root accounts.
janv. 02 22:05:04 danya.server.net /etc/mysql/debian-start[7462]: Triggering myisam-recover for all MyISAM tables
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: How to launch mysql at startup ?
  • Quote

Post by skurudo » Tue Jan 19, 2016 11:40 am

Spheerys wrote: But is was started manually
Strange behavior, I heard about Percona startup troubles, but this is terrible situation.
Seriosly, don't really know, what we can do for you. ;(
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to launch mysql at startup ?
  • Quote

Post by Spheerys » Tue Jan 19, 2016 1:22 pm

Thanks for the answer.
I will check forward for this problem :)
Top


Post Reply
  • Print view

8 posts • Page 1 of 1

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password