What is the difference between the teams?

Here is the first – /etc/init.d/mysql start
Here is the second service mysql start
How do they differ?
To the VPS when the server starts running service mysql start, but mysql does not work (error Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'). You have to stop mysql server and start via /etc/init.d/mysql start.
What is the difference between teams?
July 9th 19 at 12:49
2 answers
July 9th 19 at 12:51
service runs a System V init script in the most "predictable" environment(removing most of the current environment variables)
In fact, the only LANG and TERM variables which are passed to the init script.
It is important to note that /etc/init.d/ deprecated in the next major versions of Linux distributions will not work.
Ie use the service. Let's see what variables you have regarding MySql.
The error you see(as far as I know)
corrected by replacing the path from localhost to in your client(thereby "forcing" the client to connect not through the socket and tcp)
In any case, show the logs, it might have something to say.
July 9th 19 at 12:53
The first is the old syntax for /sbin/init (the traditional System V)
The second is the syntax for a newer upstart.
In General, both versions are already outdated :)
What is the difference in the scripts you can see a trivial text editor.
This is not the syntax of upstart. It and than use upstart. - Weston98 commented on July 9th 19 at 12:56
who is not tell me? systemd uses systemctl, other any other provisioning systems used Ubuntu I just don't know :) - Concepcion.Walsh commented on July 9th 19 at 12:59
in FreeBSD, for example, the same syntax. But there is not exactly an upstart. - Weston98 commented on July 9th 19 at 13:02
: well, I can also write helloword, to call his service, and say that not only upstart uses this syntax. All we are talking about Linux, specifically on Ubuntu, which allows you to draw accurate conclusions about the init system. - sister58 commented on July 9th 19 at 13:05

Find more questions by tags LinuxUbuntuMySQL