If you have just been given access to a server with some form of MySQL on it and you want to find out about it...
ps -ef | grep mysql
Will prove it's actually running and show who it's running as. Note that whichever user mysql is actually running as, you will normally need 'root' access to be able to manage MySQL.cat /etc/my.cnf
Will show you the config, or link you to the config, and may also give some hints as to what flavour of MySQL you are dealing with.e.g. Percona will link to these locations from /etc/my.cnf...!includedir /etc/my.cnf.d/mysql -V
You might get lucky and be able to run the mysql client as your login user. Even better if you know some database users and their passwords.sudo systemctl status mysqld
sudo service mysql status
mysql -uusername -p -estatus
sudo /etc/init.d/mysql status
This only works on some systems
sudo systemctl start mysqld
sudo service mysql start
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld"
or (assuming a MySQL Windows Service has been configured)
sc start mysqld_service_name
or
NET START mysqld_service_name
sudo service mysql stop
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" -u root shutdown -p
or (assuming a MySQL Windows Service has been configured)
sc stop mysqld_service_name
or
NET STOP mysqld_service_name
mysql -V
mysql --version
mysqld --version
If there are no firewalls blocking your route, you can also get basic version information using telnet or nc...
telnet myserver 3306
nc myserver 3306
Example output from nc...
U8.0.23-commercial(h(Mj3_*n▒▒▒▒▒5ek-*(1LNcaching_sha2_password^CSELECT VERSION();
SELECT @@VERSION;
SHOW VARIABLES LIKE "%version%";
SHOW GLOBAL STATUS LIKE 'Uptime';
SELECT TIME_FORMAT(SEC_TO_TIME(VARIABLE_VALUE ),'%Hh %im') AS Uptime
FROM information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME='Uptime';
source /path/script.sql