Remove root user from mysql and it chashes

Hello!

i’ve recently created a mysql database in azure… after create it, i remove the root user. And after that, a have some crashes on the database.

can anyone help me?

Hi @ptparisi,

We are afraid to tell you that this Community forum is intended to solve problems related with the Bitnami Stacks, Virtual Machine or Cloud Images.

We highly recommend our users to look for information in more specialized forums when they have problems related with the Application or how to customize its content. In this case, you can visit:
https://dev.mysql.com/doc/
https://forums.mysql.com/

Even so, you can try this solution:
Locate in the directory of your application and follow these steps:

  1. Load the environment ./use_yourApplication
  2. Add ‘skip-grant-tables’ to mysql/my.cnf under the [mysqld] section
  3. Restart mysql ./ctlscript restart mysql
  4. Run mysql with no user and password
  5. Run this command to delete the root user definitively:
DELETE FROM mysql.user 
WHERE  user = 'root' 
       AND host = 'localhost'; 
  1. Restore root user:
INSERT INTO mysql.user 
    SET User = 'root',
  Host = 'localhost',
  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',
  ssl_cipher = '',
  x509_issuer = '',
  x509_subject = '',
  Create_tablespace_priv = 'y';
  1. Choose a new password ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEW_ROOT_PASSWORD';
  2. Exit from mysql
  3. Remove ‘skip-grant-tables’ to mysql/my.cnf under the [mysqld] section
  4. Restart mysql ./ctlscript restart mysql
  5. Now, you can access with root user and your new password mysql -u root -p

Best regards,
Carlos R. Hernández