[url]http://dev.mysql.com/doc/refman/5.1/zh/installing.html#default-privileges[/url]
[size=small]
--查找所有账户:
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');[/size]
[size=small]
MAC
[url]http://www.cnblogs.com/macro-cheng/archive/2011/10/25/mysql-001.html[/url]
[url]http://everlook.iteye.com/blog/1264977[/url]
安装的目录:/usr/local/mysql/
在shell下找不到,要设环境变量。
sudo vim /etc/bashrc
export PATH=/usr/local/mysql/bin/:$PATH
source /etc/bashrc
立即生效
[/size]
[size=small]
--查找所有账户:
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');[/size]
[size=small]
MAC
[url]http://www.cnblogs.com/macro-cheng/archive/2011/10/25/mysql-001.html[/url]
[url]http://everlook.iteye.com/blog/1264977[/url]
安装的目录:/usr/local/mysql/
在shell下找不到,要设环境变量。
sudo vim /etc/bashrc
export PATH=/usr/local/mysql/bin/:$PATH
source /etc/bashrc
立即生效
[/size]