|
发表于 2019-5-24 20:55:35
|
显示全部楼层
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/
mysql> select user,host,password from mysql.user;查看用户信息
+------+------------+-------------------------------------------+
| user | host | password |
+------+------------+-------------------------------------------+
| root | localhost | |
| root | 10-6-3-176 | |
| root | 127.0.0.1 | |
| root | % | |
+------+------------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> set password for root@localhost=password('XXXXXXX');设置root密码
mysql> set password for root@'10-6-6-23'=password('XXXXXXXX');
mysql> grant all on *.* to root@"%" identified by 'XXXXXXXX';授权
mysql> select user,host,password from mysql.user;
+------+------------+-------------------------------------------+
| user | host | password |
+------+------------+-------------------------------------------+
| root | localhost | *C07583ABFCBBCC5D64C9469E28D4861951C5024A |
| root | 10-6-3-176 | *C07583ABFCBBCC5D64C9469E28D4861951C5024A |
| root | 127.0.0.1 | |
| root | % | *4F048907E92401E909B60D4C90426C4D3AEB499D |
+------+------------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> delete from mysql.user where user='';删除匿名用户
mysql> grant select on uctot.* to 小用户@'%' identified by "XXXXXXXX";授权
mysql> show grants for root@"%";查看用户有那些权限
mysql> grant select on *.* to chinatot@"%" identified by 'XXXXXXXXX';
mysql> flush privileges;
mysql> exit |
|