修改用户名: mysql> use mysql; 选择数据库Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> update user set user="deve" where user="root"; 将用户名root改为deve Query OK, 4 rows affected (0.12 sec) Rows matched: 4 Changed: 4 Warnings: 0 mysql> flush privileges; 刷新权限 Query OK, 0 rows affected (0.04 sec) 修改密码: 1.直接在数据库中修改记录 mysql> use mysql 2.在数据库中运行set password 让别的电脑访问到本机MySql数据库: grant all on *.* to 'deve'@'%' identified by 'deve'; 第一个deve表示别的电脑连接是需要用到的用户名,第二个deve表示别的电脑连接时用的密码。%表示给所有用户权限。 如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword'. |
|
来自: dabinglibrary > 《Mysql》