How to Change WordPress DB Version Using Mysql Command Prompt

Enter mysql shell prompt

user@server:~$ mysql -u root -p
Enter password:

use database name wordpress or the name you choose at the beginning of time

mysql> use wordpress;

in the following example we ask to show the info for the wordpress db version,
the actual value is 33056 and option_id is 49

mysql> select * from wp_options where option_name = 'db_version';
+-----------+-------------+--------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+--------------+----------+
|        49 | db_version  | 33056        | yes      |
+-----------+-------------+--------------+----------+
1 row in set (0.00 sec)

we want to change wordpress db version from 33056 to 37965

mysql> update wp_options set option_value = '37965' where option_id = 49;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

here we check if value has been changed

mysql> select * from wp_options where option_name = 'db_version';
+-----------+-------------+--------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+--------------+----------+
|        49 | db_version  | 37965        | yes      |
+-----------+-------------+--------------+----------+
1 row in set (0.01 sec)

done.

mysql> quit;

Leave a comment

Your email address will not be published. Required fields are marked *