- 무식한 방법(root 권한이 있을 경우)
bash$>mysql -u root -p
password : ************
mysql>use mysql
mysql>update user set Host='%', 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' where User='USER_ID';
- 그랜트를 이용한 방법
모두: grant all privileges on 디비명.* to 계정@"%" identified by '암호';
특정: grant select,insert,update,delete on 디비명.* to 계정@localhost identified by '암호';
- 암호바꾸기
set password for '계정@localhost'=old_password('NEW_PASSWORD');
- 적용시키기
mysql>flush privileges;
또는
bash$>mysqladmin -u root -p reload
password : ************