일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- 잡토이 메이킹 코딩 학원
- Spring Security
- jsp
- 설정
- oracle
- Unity
- Android
- 잡토이
- 설치
- s4a
- jobtoy
- 파주
- html5
- 예제
- 스크래치
- 톰캣
- mysql
- 리브레캐드
- 코딩
- 운정
- 유니티
- tomcat
- MSSQL
- librecad
- 라즈베리파이
- 안드로이드
- 강좌
- 아두이노
- 시작하기
- 오라클
- Today
- Total
랩제이
[mysql] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 본문
[mysql] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
labj 2017. 8. 27. 13:10[mysql] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
1. root 암호 설정
- 먼저 mysqld_safe로 접속 가능하게 한다.
/usr/bin/mysqld_safe --skip-grant-tables &
- mysql에 접속한다.
mysql -u root mysql
- 암호 설정한다.
mysql> update mysql.user SET authentication_string=PASSWORD('password!') WHERE user='root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
- mysqld 서비스를 다시 시작한다.
service mysqld restart
- 서버 재시작
shutdown -r now
- 다시 재접속
mysql -u root -p
- 유저 추가시에 오류 발생
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
- 암호 대소문자,특수문자,숫자 넣어 복잡하게 만들어야 함
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> SET PASSWORD = PASSWORD('***********');
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> create user 'jobtoy'@'%' identified by '********';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'jobtoy'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> create user 'jobtoy'@'localhost' identified by '********';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'jobtoy'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> create user 'jobtoy'@'127.0.0.1' identified by '********';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'jobtoy'@'127.0.0.1';
Query OK, 0 rows affected (0.00 sec)
'database > mysql' 카테고리의 다른 글
테이블에서 랜덤으로 n개씩 data 뽑기 (1) | 2024.01.31 |
---|---|
[mysql] CentOS 에서 MySQL 5.7 설치 (0) | 2017.08.27 |
[mysql] select procedure 만들기 (0) | 2017.01.20 |
[mysql] 문자를 datetime으로 변환하기 (0) | 2015.07.26 |
[mysql] centos 구버전 mysql 사용시 secure_auth 접속 오류 해결 (0) | 2014.10.28 |