原文:
1、先定位到mysql安装目录bin文件夹
2、cmd打开doc,cd ..\..\..\bin
3、mysql -u root -p 数据库名
然后进行下述操作
mysql> use mysql(数据库名);
Database changed
mysql> GRANT ALL PRIVILEGES ON *.* TO '用户名'@'允许连接ip(所有为%)' IDENTIFIED BY '密码' WITH GRANT OPTION;flush privileges;Query OK, 0 rows affected (0.00 sec)
mysql> select host,user,password from user;
+--------------+------+-------------------------------------------+| host | user | password |+--------------+------+-------------------------------------------+| localhost | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E || 192.168.1.1 | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E || % | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |+--------------+------+-------------------------------------------+3 rows in set (0.00 sec)