`

mac mysql

阅读更多

sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
After I’ve been searching alot I finally mananged it to delete MySQL from my Macbook pro.

The steps:

First you need to edit the file in: /etc/hostconfig and remove the line


Since this is a system file I advise you to open it with nano in terminal:

引用

Open Terminal
sudo nano /etc/hostconfig
Enter your password if you’re not authed yet.
Delete the following line: “MYSQLCOM=-YES-”
CTRL+X (This is the command for closing NANO, Enter the “Y” key to save the file and exit nano).
Second step:

Make sure MySQL is not running.

Open Terminal and copy and paste and run the following commands:
引用

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm /etc/my.cnf

MySQL is now removed from your MAC.

 

1)查看mysql 历史操作纪录 ~/.mysql_history

 

 

2)#login mysql

mysql -uroot

#show all database

show databases;

#login system user database

use mysql
1.添加用户
GRANT ALL PRIVILEGES ON *.* TO 'build'@'localhost' IDENTIFIED BY 'build' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'build'@'%' IDENTIFIED BY 'build' WITH GRANT OPTION;

2.删除用户 :
   mysql>delete from mysql.user where user ='website' ;
   mysql>flush privileges; (刷新系统权限表)
3.修改密码

set password for build@localhost = password('build');

 

3)OS X 系统安装的mysql默认是不用my.cnf配置文件的,仅是使用默认的数据库配置值。

如要进行数据库定制,可到'/usr/local/mysql/support-files/'文件夹底下,把里面的任一个.cnf配置文件复制到/etc/目录底下并修改文件名称为my.cnf。

 

不过MAC OS X 系统的mysql确实不需要my.cnf来进行配置就已经足够可以使你满意运行了。

 

参考:http://forums.mysql.com/read.php?11,366143,376017#msg-376017

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics