C:/>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 2
Server version: 5.1.22-rc-community-log MySQL Community Server (GPL)
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
mysql> grant all privileges on *.* to 'root'@'%' identified by 'youpasswd'; //密码为必填项
Query OK, 0 rows affected (0.05 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)
重启mysql:
/etc/init.d/mysqld restart