首页 » my » 正文

解决mysql“Access denied for user 'root'@'localhost'”

# /etc/init.d/mysql stop

# mysqld_safe –user=mysql  –skip-networking &

# mysql -u root mysql

#GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;

#GRANT ALL PRIVILEGES ON *.* TO root@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;

#FLUSH PRIVILEGES;

#/etc/init.d/mysql restart