컴퓨터/노트북/인터넷
IT 컴퓨터 기기를 좋아하는 사람들의 모임방
1. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
2. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
mysql >update user set password=password('비번') where user='유저'; //비번변경
mysql >flush privileges; // 적용
>> 해결 방법 : flush privileges >> grant 테이블을 reload하여 변경사항을 적용하는 것이므로 이것을 안 했을 경우에는 shutdown이나 reload를 하면 적용이 됩니다.
# /usr/local/mysql/bin/mysqladmin -u root -p reload
# killall mysqld
# 2번처럼 비번변경
Are you logging into MySQL as root? You have to explicitly grant privileges to your "regular" MySQL user account while logged in as MySQL root.
First set up a root account for your MySQL database.
In the terminal type:
mysqladmin -u root password 'password'
To log into MySQL, use this:
mysql -u root -p
To set the privileges manually start the server with the skip-grant-tables option, open mysql client and manually update the mysql.user table and/or the mysql.db tables. This can be a tedious task though so if what you need is an account with all privs I would do the following.
Start the server with the skip-grant-tables
option
Start mysql client (without a username/password)
Issue the command
flush privileges;
which forces the grant tables to be loaded.
Create a new account with the GRANT command something like this (but replacing username and password with whatever you want to use.
GRANT ALL on *.* to 'username'@'localhost' identified by 'password';
Restart the server in normal mode (without skip-grant-tables) and log in with your newly created account.
Refer this MySQL docs.