How to get installed Drupal version from MySQL database

To get installed Drupal version from MySQL database use the following SQL query:

select name,type,info from system where type = 'module' and name = 'node';

Inside info you will see serialized data something like:
s:7:”package”;s:4:”Core”;s:7:”version”;s:4:”7.22″
or
s:7:”package”;s:15:”Core – required”;s:7:”version”;s:4:”6.28″

3 thoughts on “How to get installed Drupal version from MySQL database

  1. Interesting. I wonder what was your use case for needing this? Could you have done something like this from the local site:

    drush status | grep ‘Drupal version’

    or this remotely:

    curl example.com/CHANGELOG.txt | head -n 2

    1. I am deleteing all Drupal default text files including CHANGELOG.txt from my production servers.

Comments are closed.