mysql>UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y',Password=password('wtfwtfwtf') WHERE User='ranger' and host='localhost'; mysql>flush privileges;
搞定之后记得关闭mysqld_safe,并开启mysqld进程。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
$ sudo mysqladmin -uroot -p***** shutdown $ sudo service mysqld start $ mysql -uranger -pwtfwtfwtf Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 20 Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h'forhelp. Type '\c' to clear the current input statement.
mysql>
测试后ok
新加入规则也很简单
1
mysql>insert into mysql.user(Host,User,Password) values("127.0.0.1","ranger",Password=password('wtfwtfwtf'));