Lost All Root user Privileges in MYSQL

Solution :

Stop your MySQL service

/etc/init.d/mysqld

stop (UNIX style)

Start your MySQL with privileges

/usr/bin/mysqld_safe –skip-grant-tables

Connect to mysql DB with your root user /usr/bin/mysql -uroot -p mysql

Update root privileges

update user set Select_priv=’Y’, Insert_priv=’Y’,Update_priv=’Y’,Delete_priv=’Y’, Create_priv=’Y’,Drop_priv=’Y’,Reload_priv=’Y’,Shutdown_priv=’Y’, Process_priv=’Y’,File_priv=’Y’,Grant_priv=’Y’,References_priv=’Y’, Index_priv=’Y’,Alter_priv=’Y’,Show_db_priv=’Y’,Super_priv=’Y’, Create_tmp_table_priv=’Y’,Lock_tables_priv=’Y’,Execute_priv=’Y’, Repl_slave_priv=’Y’,Repl_client_priv=’Y’,Create_view_priv=’Y’, Show_view_priv=’Y’,Create_routine_priv=’Y’,Alter_routine_priv=’Y’, Create_user_priv=’Y’,Event_priv=’Y’,Trigger_priv=’Y’ where User=’root’;

After that, you just need to stop the MySQL service and start again.

 

Script to Monitor Mysql Replication

Script to Monitor Mysql Replication   #!/bin/bash # Checks MySQL Replication status.  Sends user(s) a notification of status status=0 MasterHost=”192.168.1.10″ SlaveHost=”192.168.1.11″ emails=”webmaster@techsuccor.com” #multiple emails space separated DownSubject=”Replication Status Down on $HOSTNAME” …

Another MySQL daemon already running with the same unix socket

Error : Another MySQL daemon already running with the same unix socket. [root@techsuccor~]# /etc/init.d/mysqld start Another MySQL daemon already running with the same unix socket. Starting mysqld:                                           [FAILED] [root@techsuccor ~]# …