[MariaDB/MySQL] 로컬호스트 접속 오류 #2

2023. 4. 30. 02:49리눅스 실제 사용 팁/Maria DB

접속 오류 #1 에서 소켓 문제를 해결하고 나서, 리눅스 일반 사용자 계정에서 Maria DB 의 root 계정으로 접속을 시도했더니

역시나 집에서 테스트 DB 설정하다가 포기하게 만드는 귀찮은 오류가 나온다. 바로 Access denied 이다.

$ mariadb -u root -S /tmp/mysql.sock
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

이건 sudo 명령을 앞에 붙이면 간단히 해결된다.

$ sudo mariadb -u root -S /tmp/mysql.sock
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.11.2-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>