DB(SQL)

[MySQL] root 패스워드 변경

_주야 2017. 3. 16. 19:05

 

MySQL 접속 root 패스워드 변경

 

1. MySQL 접속

# ./mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.54 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>update user set password=password('새로운 패스워드') where user='root';

mysql>flush privileges;

mysql>quit;

 

2. MySQL 재시작

# service mysql restart

 

3. 확인

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.54 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>


 

 

'DB(SQL)' 카테고리의 다른 글

[MySQL] 원격 접속 특정 IP 허용  (0) 2017.03.16
[MySQL] Mysql 설치 (mysql 5.5.54)  (0) 2017.03.15
[SQL] commit  (0) 2017.02.28
[SQL] 테이블 생성/복사/삭제  (0) 2017.02.28
[SQL] 제약조건 연습  (0) 2017.02.28