title: I can't see databases after restore content of folder /var/lib/mysql
body: <p>Maybe it will a duplicate topic but after two days of googling and trying a lot of settings combinaton i need help with my MySQL server...</p>
  <p>My MySQL server is accidentally died but i have stored all data from folder <code>/var/lib/mysql</code>.</p>
  <p>Before a clean install of MySQL server i cleared all content from folder <code>/var/lib/mysql</code>.
  <a href="https://askubuntu.com/questions/964417/is-it-possible-to-restore-a-mysql-database-from-the-var-lib-mysql-database-fold">According to the these instructions</a> after install MySQL i copied <em>database folders (and all their content) back to /var/lib/mysql. Then also copy ib(asterisk) to /var/lib/mysql as well)</em>.
  And after this i setting chown to <code>mysql:mysql</code> and i restarted a server.
  But after restart i can see only &quot;default&quot; databases and i cann't see my DB.</p>
  <pre><code>mysql&gt; SHOW DATABASES;
  +--------------------+
  | Database           |
  +--------------------+
  | information_schema |
  | mysql              |
  | performance_schema |
  | sys                |
  +--------------------+
  4 rows in set (0.00 sec)
  </code></pre>
  <p>Please, what am i doing wrong? Is possible to full &quot;restore&quot; databases from data from folder <code>/var/lib/mysql</code></p>
  <p>If yes, please how?</p>
  <p>My server isn't working and i can't do sqldump :/</p>
  <pre><code>mysql -V
  mysql  Ver 8.0.21-0ubuntu0.20.04.4 for Linux on x86_64 ((Ubuntu))
  </code></pre>
  <p>Thank you for any ideas...</p>
  <h3>Update: List of my steps</h3>
  <p>It is really serious problem for me and for sure i write here all steps which i do:</p>
  <ol>
  <li>complete backup of folder <code>/var/log/mysql</code></li>
  <li>uninstall all with <code>apt --purge remove mysql-*</code></li>
  <li>delete all files with:</li>
  </ol>
  <pre><code>sudo rm -rf /var/lib/mysql
  sudo rm -rf /etc/mysql
  sudo rm -rf /var/log/mysql
  </code></pre>
  <ol start="4">
  <li>install <code>apt install mysql-server</code></li>
  <li>create mysql user <code>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxx';</code></li>
  <li>stop mysql server <code>systemctl stop mysql.service</code></li>
  <li>copy files:</li>
  </ol>
  <pre><code>mkdir /var/lib/mysql/test_db1
  cp -Rv db_backup/mysql/test_db1/* /var/lib/mysql/test_db1/
  cp -Rv db_backup/mysql/ib* /var/lib/mysql/
  </code></pre>
  <ol start="8">
  <li>change owner to mysql with command</li>
  </ol>
  <pre><code>chown -R mysql:mysql /var/lib/mysql 
  </code></pre>
  <ol start="9">
  <li>Add these rows</li>
  </ol>
  <pre><code>[mysqld]
  innodb_force_recovery = 4
  </code></pre>
  <p>to file <code>/etc/mysql/my.cnf</code></p>
  <ol start="10">
  <li>start server with <code>systemctl start mysql.service</code></li>
  <li>log with <code>sudo lnav /var/log/mysql/error.log</code></li>
  </ol>
  <pre><code>[sudo] password for xxxxxxx: 
  2020-09-21T06:43:04.044711Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) initializing of server in progress as process 3474
  2020-09-21T06:43:04.055166Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-21T06:43:04.796495Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-21T06:43:06.353841Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
  2020-09-21T06:43:07.931371Z 6 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.21-0ubuntu0.20.04.4).
  2020-09-21T06:43:11.425181Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 3531
  2020-09-21T06:43:11.473322Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-21T06:43:11.917313Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-21T06:43:12.154931Z 0 [ERROR] [MY-011292] [Server] Plugin mysqlx reported: 'Preparation of I/O interfaces failed, X Protocol won't be accessible'
  2020-09-21T06:43:12.156589Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
  2020-09-21T06:43:12.369358Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-21T06:43:12.369606Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
  2020-09-21T06:43:12.375351Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
  2020-09-21T06:43:12.417636Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.21-0ubuntu0.20.04.4'  socket: '/tmp/tmp.MdU5Jvz6dw/mysqld.sock'  port: 0  (Ubuntu).
  2020-09-21T06:43:12.570511Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user &lt;via user signal&gt;. Shutting down mysqld (Version: 8.0.21-0ubuntu0.20.04.4).
  2020-09-21T06:43:14.014132Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu).
  2020-09-21T06:43:15.325632Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 3600
  2020-09-21T06:43:15.356322Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-21T06:43:15.710982Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-21T06:43:15.909195Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
  2020-09-21T06:43:15.909589Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
  2020-09-21T06:43:16.117225Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-21T06:43:16.117469Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
  2020-09-21T06:43:16.126169Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
  2020-09-21T06:43:16.176374Z 7 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.21-0ubuntu0.20.04.4).
  2020-09-21T06:43:18.426002Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu).
  2020-09-21T06:43:20.526272Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 3769
  2020-09-21T06:43:20.536771Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-21T06:43:20.970922Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-21T06:43:21.276105Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
  2020-09-21T06:43:21.439577Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-21T06:43:21.439841Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
  2020-09-21T06:43:21.488037Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.21-0ubuntu0.20.04.4'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  2020-09-21T06:46:03.582451Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user &lt;via user signal&gt;. Shutting down mysqld (Version: 8.0.21-0ubuntu0.20.04.4).
  2020-09-21T06:46:06.519055Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu).
  2020-09-21T07:02:45.464610Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 775
  2020-09-21T07:02:45.631164Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-21T07:02:47.973692Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-21T07:02:49.148633Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
  2020-09-21T07:02:49.666907Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-21T07:02:49.670219Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
  2020-09-21T07:02:49.893631Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.21-0ubuntu0.20.04.4'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  2020-09-21T07:17:42.508256Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user &lt;via user signal&gt;. Shutting down mysqld (Version: 8.0.21-0ubuntu0.20.04.4).
  2020-09-21T07:17:44.780217Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu).
  2020-09-21T07:28:58.520769Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 1443
  2020-09-21T07:28:58.550931Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-21T07:28:59.004925Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-21T07:28:59.210887Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in InnoDB read-only mode.
  2020-09-21T07:28:59.243529Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
  2020-09-21T07:28:59.244407Z 2 [Warning] [MY-011018] [Server] Skip updating information_schema metadata in InnoDB read-only mode.
  2020-09-21T07:28:59.246569Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
  2020-09-21T07:28:59.246712Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
  2020-09-21T07:28:59.304228Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-21T07:28:59.304477Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
  2020-09-21T07:28:59.359899Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.21-0ubuntu0.20.04.4'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  2020-09-21T11:42:53.341383Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user &lt;via user signal&gt;. Shutting down mysqld (Version: 8.0.21-0ubuntu0.20.04.4).
  2020-09-21T11:42:54.999842Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu).
  2020-09-21T11:44:42.649789Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 773
  2020-09-21T11:44:42.751076Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-21T11:44:44.618159Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-21T11:44:45.687042Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in InnoDB read-only mode.
  2020-09-21T11:44:45.745974Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
  2020-09-21T11:44:45.750371Z 2 [Warning] [MY-011018] [Server] Skip updating information_schema metadata in InnoDB read-only mode.
  2020-09-21T11:44:45.767617Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
  2020-09-21T11:44:45.767836Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
  2020-09-21T11:44:46.019318Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-21T11:44:46.019570Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
  2020-09-21T11:44:46.220355Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.21-0ubuntu0.20.04.4'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  </code></pre>
  <ol start="12">
  <li>check database in DBeaver and i see only:</li>
  </ol>
  <pre><code>mysql&gt; SHOW DATABASES;
  +--------------------+
  | Database           |
  +--------------------+
  | information_schema |
  | mysql              |
  | performance_schema |
  | sys                |
  +--------------------+
  4 rows in set (0.00 sec)
  </code></pre>
  <h2>Update 2: Output of show global variables</h2>
  <pre><code>mysql&gt; show global variables like '%dir%';
  +-----------------------------------------+----------------------------+
  | Variable_name                           | Value                      |
  +-----------------------------------------+----------------------------+
  | basedir                                 | /usr/                      |
  | binlog_direct_non_transactional_updates | OFF                        |
  | character_sets_dir                      | /usr/share/mysql/charsets/ |
  | datadir                                 | /var/lib/mysql/            |
  | innodb_data_home_dir                    |                            |
  | innodb_directories                      |                            |
  | innodb_doublewrite_dir                  |                            |
  | innodb_log_group_home_dir               | ./                         |
  | innodb_max_dirty_pages_pct              | 90.000000                  |
  | innodb_max_dirty_pages_pct_lwm          | 10.000000                  |
  | innodb_redo_log_archive_dirs            |                            |
  | innodb_temp_tablespaces_dir             | ./#innodb_temp/            |
  | innodb_tmpdir                           |                            |
  | innodb_undo_directory                   | ./                         |
  | lc_messages_dir                         | /usr/share/mysql/          |
  | plugin_dir                              | /usr/lib/mysql/plugin/     |
  | slave_load_tmpdir                       | /tmp                       |
  | tmpdir                                  | /tmp                       |
  +-----------------------------------------+----------------------------+
  18 rows in set (0.00 sec)
  
  </code></pre>
  <h2>Update 3: error log after copy entire folder /var/lib/mysql</h2>
  <p>In this attempt was in <code>/etc/mysql/my.cnf</code> added</p>
  <pre><code>[mysqld]
  innodb_force_recovery = 4
  </code></pre>
  <p>and in next attemps was used value 5, 6. Output of log was same.</p>
  <pre><code>sudo cat /var/log/mysql/error.log
  2020-09-22T07:46:22.739869Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 2624
  2020-09-22T07:46:22.753948Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-22T07:46:23.150836Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-22T07:46:23.153580Z 1 [ERROR] [MY-011096] [Server] No data dictionary version number found.
  2020-09-22T07:46:23.153802Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
  2020-09-22T07:46:23.154040Z 0 [ERROR] [MY-010119] [Server] Aborting
  2020-09-22T07:46:23.665236Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu).
  2020-09-22T07:46:24.159762Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 2650
  2020-09-22T07:46:24.173618Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-22T07:46:24.561326Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-22T07:46:24.564213Z 1 [ERROR] [MY-011096] [Server] No data dictionary version number found.
  2020-09-22T07:46:27.556958Z 0 [ERROR] [MY-010119] [Server] Aborting
  2020-09-22T07:46:28.067684Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu).
  2020-09-22T07:46:28.652845Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 2710
  2020-09-22T07:46:28.670270Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-22T07:46:29.054648Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-22T07:46:29.057477Z 1 [ERROR] [MY-011096] [Server] No data dictionary version number found.
  2020-09-22T07:46:29.057705Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
  2020-09-22T07:46:29.057912Z 0 [ERROR] [MY-010119] [Server] Aborting
  2020-09-22T07:46:29.568544Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21-0ubuntu0.20.04.4)  (Ubuntu)
  </code></pre>
  <h2>Update 4: Restored &quot;older&quot; version of server with same version of MySQL</h2>
  <p>When i copied only db folder and files <code>ib*</code> after start of MySLQ, i don't saw any errors in log but in DBeaver i don't saw my restored DB (only &quot;default&quot; databases).</p>
  <p>When i copied full folder <code>/var/lib/mysql</code> after start of server, terminal shown:</p>
  <pre><code>sudo systemctl start mysql.service 
  Job for mysql.service failed because the control process exited with error code.
  See &quot;systemctl status mysql.service&quot; and &quot;journalctl -xe&quot; for details.
  </code></pre>
  <p>and in <code>sudo lnav /var/log/mysql/error.log</code> was logged errors.</p>
  <p>Full log:</p>
  <pre><code>2020-05-08T18:30:05.405899Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) initializing of server in progress as process 3730
  2020-05-08T18:30:05.415536Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-05-08T18:30:10.973980Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-05-08T18:30:19.418435Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
  2020-05-08T18:30:29.248033Z 6 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.20-0ubuntu0.20.04.1).
  2020-05-08T18:30:39.563577Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 3784
  2020-05-08T18:30:39.609342Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-05-08T18:30:40.825826Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-05-08T18:30:41.069690Z 0 [ERROR] [MY-011292] [Server] Plugin mysqlx reported: 'Preparation of I/O interfaces failed, X Protocol won't be accessible'
  2020-05-08T18:30:41.070005Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
  2020-05-08T18:30:41.562105Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-05-08T18:30:41.570251Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
  2020-05-08T18:30:41.597449Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20-0ubuntu0.20.04.1'  socket: '/tmp/tmp.tPMiFvGi8X/mysqld.sock'  port: 0  (Ubuntu).
  2020-05-08T18:30:44.447698Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
  2020-05-08T18:30:45.523547Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 3855
  2020-05-08T18:30:45.533828Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-05-08T18:30:46.312690Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-05-08T18:30:46.461804Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
  2020-05-08T18:30:46.462073Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
  2020-05-08T18:30:46.789266Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-05-08T18:30:46.798154Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
  2020-05-08T18:30:46.841228Z 7 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.0.20-0ubuntu0.20.04.1).
  2020-05-08T18:30:48.523578Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
  2020-05-08T18:30:50.775196Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 4024
  2020-05-08T18:30:50.784578Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-05-08T18:30:51.773989Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-05-08T18:30:51.925901Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
  2020-05-08T18:30:52.076910Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-05-08T18:30:52.103666Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20-0ubuntu0.20.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  2020-09-23T13:34:43.685315Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 844
  2020-09-23T13:34:43.774085Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-23T13:34:45.075312Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-23T13:34:45.386676Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
  2020-09-23T13:34:45.440758Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
  2020-09-23T13:34:45.513241Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
  2020-09-23T13:34:45.740429Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-23T13:34:45.803306Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20-0ubuntu0.20.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  2020-09-23T13:55:41.660814Z 0 [Warning] [MY-010909] [Server] /usr/sbin/mysqld: Forcing close of thread 9  user: 'dataintegra'.
  2020-09-23T13:55:42.751286Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
  2020-09-23T13:57:03.148302Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 2646
  2020-09-23T13:57:03.160530Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-23T13:57:03.175203Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/visitscalendar.ibd'
  2020-09-23T13:57:03.175349Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/specializations_prim.ibd'
  2020-09-23T13:57:03.175460Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/visitscalendar_manager.ibd'
  2020-09-23T13:57:03.175870Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/roles.ibd'
  2020-09-23T13:57:03.176006Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/direct_orders_products.ibd'
  2020-09-23T13:57:03.176139Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/companies.ibd'
  2020-09-23T13:57:03.176281Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/specializations_sec.ibd'
  2020-09-23T13:57:03.176468Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/targetings.ibd'
  2020-09-23T13:57:03.177021Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/districts.ibd'
  2020-09-23T13:57:03.177219Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/alembic_version.ibd'
  2020-09-23T13:57:03.177451Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/subject_types.ibd'
  2020-09-23T13:57:03.177650Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/users.ibd'
  2020-09-23T13:57:03.177857Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/settings.ibd'
  2020-09-23T13:57:03.178071Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/reports.ibd'
  2020-09-23T13:57:03.178288Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/subjects.ibd'
  2020-09-23T13:57:03.178529Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/targetings_of_subjects.ibd'
  2020-09-23T13:57:03.178774Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/report_products_association.ibd'
  2020-09-23T13:57:03.179090Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/promo_products.ibd'
  2020-09-23T13:57:03.708748Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-23T13:57:04.043407Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
  2020-09-23T13:57:04.152664Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-23T13:57:04.194179Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20-0ubuntu0.20.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  2020-09-23T13:57:34.288929Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
  2020-09-23T13:58:27.611679Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 2774
  2020-09-23T13:58:27.622170Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-23T13:58:27.964705Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-23T13:58:28.067741Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in InnoDB read-only mode.
  2020-09-23T13:58:28.073551Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
  2020-09-23T13:58:28.073930Z 2 [Warning] [MY-011018] [Server] Skip updating information_schema metadata in InnoDB read-only mode.
  2020-09-23T13:58:28.075060Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
  2020-09-23T13:58:28.075198Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
  2020-09-23T13:58:28.117418Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  2020-09-23T13:58:28.140691Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20-0ubuntu0.20.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
  2020-09-23T13:59:25.135939Z 0 [Warning] [MY-010909] [Server] /usr/sbin/mysqld: Forcing close of thread 8  user: 'dataintegra'.
  2020-09-23T13:59:25.731711Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
  2020-09-23T14:00:42.499469Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 3039
  2020-09-23T14:00:42.550347Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-23T14:00:43.007205Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-23T14:00:43.057449Z 1 [ERROR] [MY-011096] [Server] No data dictionary version number found.
  2020-09-23T14:00:43.057906Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
  2020-09-23T14:00:43.058212Z 0 [ERROR] [MY-010119] [Server] Aborting
  2020-09-23T14:00:43.583830Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
  2020-09-23T14:00:44.201857Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 3070
  2020-09-23T14:00:44.211762Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  2020-09-23T14:00:44.588604Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
  2020-09-23T14:00:44.592967Z 1 [ERROR] [MY-011096] [Server] No data dictionary version number found.
  2020-09-23T14:00:44.593261Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
  2020-09-23T14:00:44.593479Z 0 [ERROR] [MY-010119] [Server] Aborting
  </code></pre>
  <p>Lines:</p>
  <pre><code>2020-09-23T13:57:03.175203Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/visitscalendar.ibd'
  2020-09-23T13:57:03.175349Z 1 [Warning] [MY-012197] [InnoDB] Unable to open './pharmiseu/specializations_prim.ibd'
  </code></pre>
  <p>contains names of my tables in db: <code>visitscalendar, specializations_prim</code> and <code>pharmiseu</code> is my DB.</p>
  <p>In config <code>/etc/mysql/mysql.cnf</code> was inserted rows:</p>
  <pre><code>[mysqld]
  innodb_force_recovery = 4
  
  </code></pre>
  <p>but in log is still:</p>
  <pre><code>│2020-09-23T20:28:19.427375Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).                                                 │
  │2020-09-23T20:28:19.966903Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 9601                                                      │
  │2020-09-23T20:28:19.976957Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.                                                                                              │
  │2020-09-23T20:28:20.230800Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.                                                                                                │
  │2020-09-23T20:28:20.236029Z 1 [ERROR] [MY-011096] [Server] No data dictionary version number found.                                                                                         │
  │2020-09-23T20:28:20.236340Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.                                                                                           │
  │2020-09-23T20:28:20.236550Z 0 [ERROR] [MY-010119] [Server] Aborting
  </code></pre>
  <p><a href="https://i.stack.imgur.com/oimM7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oimM7.png" alt="htop after 'sudo systemctl start mysql'" /></a></p>