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?
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 127.0.0.1 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.
Concepcion.Walsh answered on 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.