본문 바로가기

mysql 말아먹었을경우 root 권한 재부여

database by 낼스 2020. 10. 6.

# 안전모드로 mysql 실행

mysqld --datadir="C:/ProgramData/MySQL/MySQL Server 8.0/Data" --console --skip-grant-tables --shared-memory

 

mysql -u root

use mysql

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',
Create_tablespace_priv   = 'Y',
password_expired         = 'Y',
account_locked           = 'N',
Create_role_priv         = 'Y',
Drop_role_priv           = 'Y'
where user = 'root'
;

 

flush privileges;

 

'database' 카테고리의 다른 글

Transaction 의 이해  (0) 2019.08.14
SQL 이란 ?  (0) 2019.08.13
Oracle Analytic Functions 누적합계  (0) 2019.08.12
Oracle Analysis Function  (0) 2019.08.07
PostgresQL  (0) 2019.07.29

댓글