Is there a way to determine if mySql has been installed on a Linux server?
|
|
Assuming that you are looking for a mysql binary installed with a typical package, run the command:
or
If it comes back with a response, it is installed, if it says "command not found" then it is not installed. |
|||||
|
|
|
How about |
|||
|
|
Other than the good suggestions above, try:
or
If you think it might be running already try:
or
|
|||
|
|
|
On every distribution that I know of, MySQL installs some shared libraries for its client, named appropriately limbysqlclient. You can check for this by using the ldconfig tool, which will query to see if the object is installed:
This tells you that there's a very good chance that MySQL is installed. Its very rare that someone would install the shared objects only, without installing at least the client. Now, check for the existence of the actual client and server:
The `which' program may not be installed, so check for it via:
Hope this helps. Short of querying the package manager (kind of hard to do in a script if you have many systems running different distributions) it seems a very reliable way to tell. |
|||
|
|
|
The easiest and most distro-agnostic way of answering your question is;
|
|||
|
|