• -동두천 26.7℃
  • -강릉 22.9℃
  • 서울 26.1℃
  • 대전 24.3℃
  • 대구 25.4℃
  • 울산 26.2℃
  • 박무광주 29.2℃
  • 구름많음부산 29.5℃
  • -고창 26.8℃
  • 흐림제주 33.6℃
  • -강화 25.4℃
  • -보은 21.9℃
  • -금산 25.8℃
  • -강진군 30.1℃
  • -경주시 24.9℃
  • -거제 29.9℃

mysql설치후 root 패스워드 설정하기

// mysql root password 등록


[root@linux mysql]# mysql -u root -p mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 1 to server version: 4.0.23-Max

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.


mysql> update user set password=password('비밀번호입력') where user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0


mysql> flush privileges;  <==  mysql 재시동
Query OK, 0 rows affected (0.00 sec)


mysql> quit


// 접속 확인하기

[root@linux mysql]# mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 4 to server version: 4.0.23-Max

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.