070-8260-2526

9 ~ 6

352-0331-1626-83

:ũڸ


ֹ
Ȩ > > ֹ

ȸ 7979
ʱ mysql root н root Ҿ ϴ¹
[, 2006/08/04 12:30, PC Ž/]
ʱ mysql root н root Ҿ ϴ¹



1. ʱ mysql root н ϱ
mysql н α ϰԵǸ ͺ̽ ̺
Ÿ ̰ ڷᰡ ܺο ִ. ̷
root н带 ϸ mysql ϰ ȣ ִ.

mysql> use mysql;
mysql> update user set password=password('123456') where user='root';
Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges; <---
flush privileges; mysql ͼ root α ȵȴ.
ȮѴ.
mysql> select host, user, password from user;
+----------------------------------------------------------------+
| Host user password |
+----------------------------------------------------------------+
| localhost root 2e01146f5c065853 |
| localhost.localdomain root 2e01146f5c065853 |
+----------------------------------------------------------------+

mysql> q
Bye
------------------------------------------------------------------------------------
[]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
״ mysql shutdown ϰų reload ϸ ȴ.
# /usr/local/mysql/bin/mysqladmin -u root -p shutdown
ϸ н带 µ ̶ Էϸ mysql ̵ȴ.
# /usr/local/mysql/bin/mysqladmin -u root -p reload;
------------------------------------------------------------------------------------

# mysql -u root -p [Enter] // root н α
Enter password: ******

Mysql root н尡 Ǹ ʹ mysql ϱ ؼ
-u ڿ rootԷϰ -p ɼ Ͽ н带 Ѵٴ ؾ Ѵ.
׸ ͸ ġ root н带 Է¹ޱ Ŀ .
(mysql ɾ Էϰ ͸ ġ н带 ۰ ٷ mysql> Ʈ ݹ ̸ )

2. Ʈ
mysql> use mysql;
mysql> update user set password=password('123456') where user='root';
mysql> flush privileges;

3. root н带 н (ġ)

mysql ʾ 쿡 Ȥ rootн尡 ﳪʾƼ Ȳ ֽϴ. ý۰ڶ ý root MySQL root ȣ ؾ ؼ н带 ϴ ݵ ϰ ־ Դϴ.

msyql

# ps -ef | grep mysqld
root 9567 1 0 Mar16 ? 00:00:00 sh ./mysqld_safe
root 9576 9567 0 Mar16 ? 00:00:00 /usr/local/mysql/libexec/mysqld
root 9578 9576 0 Mar16 ? 00:00:00 /usr/local/mysql/libexec/mysqld
root 9579 9578 0 Mar16 ? 00:00:00 /usr/local/mysql/libexec/mysqld

# killall mysqld

grant-table ̻ mysql( ̺ ʴ ɼ )

# ./safe_mysqld --skip-grant-tables &
[1] 12084
# Starting mysqld daemon with databases from /usr/local/mysql/data
#

# ./mysql -u root 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: 3.22.24
Type 'help' for help.
mysql>

mysqld_safe ɾ mysql Ų.

update root н

mysql> update user set password=password('123') where user = 'root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> q
Bye

mysql ٽ ( ̺ ʴ )

# ps -ef | grep mysqld
root 12084 11558 0 20:10 pts/2 00:00:00 sh ./mysqld_safe --skip-grant-ta
root 12090 12084 0 20:10 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld
root 12092 12090 0 20:10 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld
root 12093 12092 0 20:10 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld
#
# killall mysqld
mysqld daemon ended
[1]+ Done ./mysqld_safe --skip-grant-tables
#

Mysql ŵ н α

# ./safe_mysqld &
[1] 12102
# Starting mysqld daemon with databases from /usr/local/mysql/data
#

# ps -ef | grep mysql
root 12102 11558 0 20:13 pts/2 00:00:00 sh ./mysqld_safe
root 12108 12102 0 20:13 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld
root 12110 12108 0 20:13 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld
root 12111 12110 0 20:13 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld

# mysql -u root -p
Enter Password: ***************