반응형
오류 발생
MySQL 로그인 시
[root@localhost data]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
해결방법
비밀번호를 잊어버린 경우
systemctl stop mysqld
/usr/bin/mysqld_safe --skip-grant &
/usr/bin/mysql -u root mysql
UPDATE mysql.user SET password=PASSWORD('비밀번호') WHERE user='root' AND Host='localhost';
FLUSH PRIVILEGES;
quit
#서비스 재시작
systemctl start mysqld
systemctl enable mysqld
#MariaDB
systemctl status mariadb.service
mysql -u root -p
시작 systemctl start mysqld
정지 systemctl stop mysqld
재시작 systemctl restart mysqld
상태확인 systemctl status mysqld
반응형
'에러 코드' 카테고리의 다른 글
mysql 사용자추가/DB생성/권한부여 (0) | 2021.03.14 |
---|---|
Centos7 Mysql Remote Navicat connects to mysql error 1130 (0) | 2021.03.14 |
[Centos] MySQL 데이터베이스 생성 삭제 (0) | 2021.02.27 |
[Centos] MariaDB root 패스워드 변경하기 (0) | 2021.02.27 |
[Centos] MariaDB 삭제 및 설치 (0) | 2021.02.27 |