If you took no backup, where did the folders/files related to moodle come from?
Where did the files/folders in /var/www/html/moodle come from?
Where did the files/folders in /var/www/moodledata come from?
Where did the files in /var/lib/mysql/moodle come from?
The files in /var/lib/mysql/moodle are the raw database files for the Moodle DB. They should be owned by the user under which MySQL runs (assuming mysql DB as you've not said) which is 'mysql' typically.
Those files should have special permissions in that only the owner has read/write/execute. and the group has 'read' permissions.
Files there look like this example of the last tables for a 3.5 moodle:
-rw-r-----. 1 mysql mysql 9306 May 17 11:57 mdl_workshop_submissions.frm
-rw-r-----. 1 mysql mysql 73728 May 17 11:58 mdl_workshop_submissions.ibd
All those files one cannot edit with anything but a DB interface ... such as phpmyadmin.
In the moodle code you have ... /var/www/html/moodle/ there is a version.php file. From what you've shared it's a version 3.5 of moodle? That's a guess ... is it? Please verify that.
In a version.php file of a 3.5.1 this following is a clip of that file:
$version = 2018051701.00; // 20180517 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '3.5.1 (Build: 20180709)'; // Human-friendly version name
$branch = '35'; // This version's branch.
$maturity = MATURITY_STABLE; // This version's maturity level.
[root@sos moodle35]#
In PHPMyAdmin, the table is mdl_config the name column set to version, displays this via mysql> shell:
mysql> select id,name,value from mdl_config where value like '2018051701';
+----+---------+------------+
| id | name | value |
+----+---------+------------+
| 28 | version | 2018051701 |
+----+---------+------------+
1 row in set (0.00 sec)
What does yours show?
I think that's what the error refers.
You should be able to edit that row ... BTW, your ID may or may not be ID 28.
Fingers crossed for ya, cause this doesn't look good with no proper sql backups of the DB. :|
'spirit of sharing, Ken