0

I get this error and I’m not able to start the MySQL server. ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

I followed this guide here https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-socket-errors-in-mysql

But I found that I don’t even have the /var/run/mysqld/ directory When I try to cd or ls that directory, it shows the directory does not exist.

I guess my own case is different, I browsed around the internet and found this solution that suggested I add

innodb_force_recovery = 6

How fix permanently: Job for mysql.service failed because the control process exited with error code

After adding that code, it still does not solve the problem

When I go into the /var/log/mysql/error.log file I get this

2022-08-08T01:40:28.108418Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30-0ubuntu0.20.04.2)  (Ubuntu).
2022-08-08T01:40:28.677008Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30-0ubuntu0.20.04.2) starting as process 271100
2022-08-08T01:40:28.688821Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-08T01:40:28.928619Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-08-08T01:40:29.023994Z 1 [Warning] [MY-011018] [InnoDB] Skip updating information_schema metadata in InnoDB read-only mode.
2022-08-08T01:40:29.229659Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in InnoDB read-only mode.
2022-08-08T01:40:29.235974Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-08T01:40:29.236037Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-08T01:40:29.760446Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30-0ubuntu0.20.04.2)  (Ubuntu).

I would appreciate any help I can get regarding this, thank you!

  • 2
    Is this a new installation of MySQL or one that has worked until recently? Did the machine have Maria DB installed before MySQL? – matigo Aug 08 '22 at 03:23
  • Ah, I don't think Maria DB was installed prior. I used the Digitalocean one click for Ghost installation to set it up, then for some reason, I don't know, it started showing 502 gateway error. When I looked into the server, it shows that MySQL is not active and shows the above error.

    Here is the version mysql Ver 8.0.30-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))

    – CollinsMbaka Aug 08 '22 at 10:52

0 Answers0