에러 발생 상화

(1) use로 Database 변경하였을때.

mysql> use kdhong_db

[MySql] ERROR 1044 (42000): Access denied for user 'user'@'localhost' to database 'userdb'

 

(2) MySQL의 ROOT계정(관리자계정)으로 아이디 생성 후 로그인 하였을때.

mysql> mysql -ulucky -p1234 lucky_db

[MySql] ERROR 1044 (42000): Access denied for user 'lucky'@'localhost' to database 'lucky_db'

 

※로그인 하는 방법 :> mysql -u아이디 -p비밀번호 데이터베이스명

 

해결방법

$ mysql -uroot -p1234

 

mysql> grant all privileges on userdb.* to 'lucky'@'localhost' identified by '패스워드' with grant option;

Query OK, 0 rows affected (0.16 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.11 sec)

+ Recent posts