Archive

‘Programming’ 分類過的Archive

[MySQL] 常用管理指令(1)

2008年5月13日 ceciltsai 尚無評論

1. 資料庫修復指令:

# /usr/bin/mysqlcheck -acor –all-databases
-a: Analyize given tables
-c: Check table for errors
-o: Optimise Table
-r: Can fix almost anything except unique keys that are not unique

2. Recovery Password

# /usr/bin/mysqld_safe –skip-grant-tables&
# /usr/bin/mysql
mysql> UPDATE mysql.user SET Password=PASSWORD(‘your_new_password_here’) \
-> WHERE User=’root’;
mysql> FLUSH PRIVILEGES;
mysql> exit
# /usr/bin/mysqladmin -u root -p shutdown

Categories: MySQL, Programming Tags: