分类: Mysql/postgreSQL
2011-11-01 13:39:27
service mysql stop
mysqld_safe --user=mysql --skip-grants-tables --skip-networking &
mysql
sql>update mysql.user set password='' where user='root';
sql>flush privileges;
sql>\q
service mysql restart
mysqladmin -u root password 'newpassword'
降低安全性:
mysql -h 192.168.0.1 -u root -p mysql
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'root-password' WITH GRANT OPTION;