日期:2014-05-16  浏览次数:20947 次

Mysql安装操作
http://dev.mysql.com/doc/refman/5.1/zh/installing.html#default-privileges

--查找所有账户:
mysql> SELECT Host, User FROM mysql.user;

--删除匿名账户,操作方法是:
mysql> DELETE FROM mysql.user WHERE User = '';

--为root账户设密码,登陆时使用mysql -u root -p :
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');



MAC
http://www.cnblogs.com/macro-cheng/archive/2011/10/25/mysql-001.html
http://everlook.iteye.com/blog/1264977

安装的目录:/usr/local/mysql/
在shell下找不到,要设环境变量。
sudo vim /etc/bashrc
export PATH=/usr/local/mysql/bin/:$PATH

source /etc/bashrc
立即生效