Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u996806617/domains/vidyut.net/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math-pro domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u996806617/domains/vidyut.net/public_html/wp-includes/functions.php on line 6114
Fix a broken mysql - Vidyut

Fix a broken mysql

If your mysql seems broken and giving errors like:

# service mysql start
start: Job failed to start

or

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Or if you try to recreate databases with mysqlinstalldb:

...
...
ERROR: 1  Can't create/write to file './mysql/db.frm' (Errcode: 13)
041226 xx:xx:xx /usr/libexec/mysqld: Can't find file: './mysql/db.frm' (errno: 13)

or all your databases go missing, even if you reinstall mysql-server.

and reinstalling mysql-server won’t work,

Before you reformat the server and use your data, you should try doing (as root, or using sudo):

apt-get install --reinstall mysql-server

chown -R mysql:mysql /var/lib/mysql

I don’t know how, but somehow the permissions get changed and mysql can no longer operate, or a reinstalled mysql still can’t see the tables. They are not gone, they are there. mysql can’t see them and that can be fixed.

Note: Some complained that if they do:

apt-get install mysql or apt-get remove mysql

They get the error that the package can’t be found. Something like:

# apt-get remove mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysql

That has nothing to do with this. This happens because the package for mysql in the repositories is mysql-server and not mysql alone. Doing apt-get install mysql-server will work.


Posted

in

by

Tags:

Comments

Leave a Reply

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