0

i have a problem with MySQL Server 8.

Well i accidentally revoked all privileges on root'@'localhost and i cant do anything now...

I need to start the mysql service on safe mode or with the "--skip-grant-tables" but the thing is i cant even start the service on the cmd line, when i type "mysqld" or "mysqld_safe" or "mysqld --skip-grant-tables" nothing happens, it justs skips the line.

Please keep in my this is MySQL Server 8.0, i cant just put skip-grant-tables and the end of my config/ini file...

1 Answers1

0
insert into user (Host, User, authentication_string, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections) 
values('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','','0','0','0','0');

You need to read these questions, answers and especially the comments!

How can I restore the MySQL root user’s full privileges?

Restoring deleted 'root' user and password for MySQL

People have left comments on how/what/where to update/change for the newer versions of MySQL but essentially this should get you working.

The first answers and its comments on each link should give you what you need.

t1f
  • 3,021
  • 3
  • 31
  • 61