备忘 - Mac下彻底删除MySQL方法

  1. sudo rm -rf /usr/local/mysql  
  2. sudo rm -rf /usr/local/mysql*  
  3. sudo rm -rf /Library/StartupItems/MySQLCOM  
  4. sudo rm -rf /Library/PreferencePanes/My*  
  5. sudo nano /etc/hostconfig     (复制前面部分回车,然后删掉这一行: MYSQLCOM=-YES-,control+O回车保存,control+X退出编辑界面)  
  6. sudo rm -rf ~/Library/PreferencePanes/My*  
  7. sudo rm -rf /Library/Receipts/mysql*  
  8. sudo rm -rf /Library/Receipts/MySQL*  
  9. sudo rm -rf /var/db/receipts/com.mysql.* 

-------------------------------------------------------------------

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

SET PASSWORD = PASSWORD('123456'); 

 

创建用户 
mysql> insert into mysql.user(Host,User,authentication_string) values("localhost","phplamp",password("1234")); 

分配权限 
grant all privileges on *.* to 'user'@'localhost' with grant option 
grant all privileges on *.* to 'user'@'localhost' identified by '123456′; 

grant all privileges on *.* to 'user'@'%' identified by '123456';

刷新系统权限表 
mysql>flush privileges;

 

posted @ 2016-06-06 13:47  HK-Yang  阅读(290)  评论(0)    收藏  举报