• 흐림동두천 17.3℃
  • 흐림강릉 21.5℃
  • 황사서울 17.6℃
  • 황사대전 22.1℃
  • 황사대구 22.8℃
  • 황사울산 20.1℃
  • 황사광주 24.0℃
  • 황사부산 17.6℃
  • 맑음고창 20.7℃
  • 황사제주 20.8℃
  • 흐림강화 12.7℃
  • 맑음보은 20.8℃
  • 맑음금산 21.4℃
  • 맑음강진군 19.6℃
  • 맑음경주시 23.1℃
  • 맑음거제 19.4℃
기상청 제공

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.