본문 바로가기

Linux

mysql root 암호 초기화

320x100

mysql root 암호 초기화

# service mysqld stop

# mysqld_safe --user=mysql --skip-grant-tables

# mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1100
Server version: 5.1.66 Source distribution

Copyright (c) 2000, 2012, 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> use mysql;
mysql> update user set password=password('새로운암호입력') where user='root';
mysql> flush privileges;
mysql> quit


320x100