Using either a SQL query, or some php code, how can I determine which version of MySQL is running.
I found several examples of using the command line, but I need to check programmatically.
I tried
SELECT @version;
But that returned NULL.
I did search stack overflow, and found a lot of questions, but they were about other dbs or programming languages. I didn’t find any specifically for MySQL.
2
Answers
Correct syntax with mysql is
select version();
Fiddle
You can get by user mysqli_server_info or the oop way using
$mysqli->server_info;
Or in MYSQL Query way
Or you may want to show in detailed way