yum update and mariadb problem

traskowski

Verified User
Joined
Nov 13, 2012
Messages
59
Hey.. I've got Cloudlinux, after yum update i've got error in starting of database.. Someone got some idea? All database is on /var/lib/mysql


Code:
[root@s1 lib]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/etc/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf, tokudb.conf
   Active: failed (Result: exit-code) since Fri 2022-12-02 03:06:23 CET; 4s ago
  Process: 84452 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 84442 ExecStartPre=/bin/sh -c [ -x /usr/bin/galera_recovery ] || exit 0; VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] &&   systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 84440 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 84452 (code=exited, status=1/FAILURE)

Dec 02 03:06:23 s1.udx.pl mysqld[84452]: 2022-12-02  3:06:23 0 [Note] Plugin 'FEEDBACK' is disabled.
Dec 02 03:06:23 s1.udx.pl mysqld[84452]: 2022-12-02  3:06:23 0 [Note] Recovering after a crash using tc.log
Dec 02 03:06:23 s1.udx.pl mysqld[84452]: 2022-12-02  3:06:23 0 [Note] Starting crash recovery...
Dec 02 03:06:23 s1.udx.pl mysqld[84452]: 2022-12-02  3:06:23 0 [Note] Crash recovery finished.
Dec 02 03:06:23 s1.udx.pl mysqld[84452]: 2022-12-02  3:06:23 0 [Warning] Failed to lock memory. Errno: 12
Dec 02 03:06:23 s1.udx.pl mysqld[84452]: 2022-12-02  3:06:23 0 [Note] Server socket created on IP: '127.0.0.1'.
Dec 02 03:06:23 s1.udx.pl mysqld[84452]: 2022-12-02  3:06:23 0 [ERROR] Fatal error: Can't open and lock privilege tables: 'mysql.user' is not of type 'TABLE'
Dec 02 03:06:23 s1.udx.pl systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Dec 02 03:06:23 s1.udx.pl systemd[1]: mariadb.service: Failed with result 'exit-code'.
Dec 02 03:06:23 s1.udx.pl systemd[1]: Failed to start MariaDB database server.
 
Ok i've got something new.. Two tables is corrupted. mysql.user and some other.. I need to repait it but when i try to repeait on mysqld_safe i've got error "mysql.user is not of type 'TABLE' Operation failed.
 
[ERROR] Fatal error: Can't open and lock privilege tables: 'mysql.user' is not of type 'TABLE'

You might need to restore mysql database on another server in MariaDB of the same version, and then safely replace files under /var/lib/mysql/mysql/.

Or you might re-install mysql server and re-import all databases, in case you don't have another server for recovery MySQL only.
 
You might need to restore mysql database on another server in MariaDB of the same version, and then safely replace files under /var/lib/mysql/mysql/.

Or you might re-install mysql server and re-import all databases, in case you don't have another server for recovery MySQL only.
I've got copy of mysql.sql only on directadmin default database dump and there is only not much:

Can i somehow on mysqld_safe repait that? This table got "view" table type.. Only FRM is on mysql folder.

SQL:
DROP TABLE IF EXISTS `user`;
/*!50001 DROP VIEW IF EXISTS `user`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE VIEW `user` AS SELECT
 1 AS `Host`,
  1 AS `User`,
  1 AS `Password`,
  1 AS `Select_priv`,
  1 AS `Insert_priv`,
  1 AS `Update_priv`,
  1 AS `Delete_priv`,
  1 AS `Create_priv`,
  1 AS `Drop_priv`,
  1 AS `Reload_priv`,
  1 AS `Shutdown_priv`,
  1 AS `Process_priv`,
  1 AS `File_priv`,
  1 AS `Grant_priv`,
  1 AS `References_priv`,
  1 AS `Index_priv`,
  1 AS `Alter_priv`,
  1 AS `Show_db_priv`,
  1 AS `Super_priv`,
  1 AS `Create_tmp_table_priv`,
  1 AS `Lock_tables_priv`,
  1 AS `Execute_priv`,
  1 AS `Repl_slave_priv`,
  1 AS `Repl_client_priv`,
  1 AS `Create_view_priv`,
  1 AS `Show_view_priv`,
  1 AS `Create_routine_priv`,
  1 AS `Alter_routine_priv`,
  1 AS `Create_user_priv`,
  1 AS `Event_priv`,
  1 AS `Trigger_priv`,
  1 AS `Create_tablespace_priv`,
  1 AS `Delete_history_priv`,
  1 AS `ssl_type`,
  1 AS `ssl_cipher`,
  1 AS `x509_issuer`,
  1 AS `x509_subject`,
  1 AS `max_questions`,
  1 AS `max_updates`,
  1 AS `max_connections`,
  1 AS `max_user_connections`,
  1 AS `plugin`,
  1 AS `authentication_string`,
  1 AS `password_expired`,
  1 AS `is_role`,
  1 AS `default_role`,
  1 AS `max_statement_time` */;
SET character_set_client = @saved_cs_client;
 
Your mysql db is corrupted. You need to recover it either from other backups or reinstall MySQL server.
 
Back
Top