Tuesday, September 22, 2015

MySQL 초기 root 패스워드 설정하기

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> update user set password=password('password') where user='root';
Query OK, 4 rows affected (0.07 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.21 sec)

mysql> select host, user, password from user;
+----------------------+------------------+-------------------------------------------+
| host                 | user             | password                                  |
+----------------------+------------------+-------------------------------------------+
| localhost            | root             | *78D22DFB85972182BE20A883D8B5021FD8B5FCCA |
| yegam400.vps.phps.kr | root             | *78D22DFB85972182BE20A883D8B5021FD8B5FCCA |
| 127.0.0.1            | root             | *78D22DFB85972182BE20A883D8B5021FD8B5FCCA |
| ::1                  | root             | *78D22DFB85972182BE20A883D8B5021FD8B5FCCA |
| localhost            | debian-sys-maint | *E54187CB3AF30C421C5063781FEE02F787E6842F |
+----------------------+------------------+-------------------------------------------+

No comments:

Post a Comment