Mysql


Mysql 5.7.19 for Mac

问题

1.Mac上安装好Mysql后,在终端输入mysql命令提示Command not found 的解决办法:
$ cd /usr/local/bin
$ ln -fs /usr/local/mysql/bin/mysql mysql

2.修改 root 密码(提示 mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES):
首先打开终端
$ sudo service mysqld stop
CD到 mysql/bin 的目录下(通常位于 /usr/local/mysql/bin)
$ cd /usr/local/mysql/bin
用sudo 运行一下命令
$ sudo mysqld_safe --skip-grant-tables
再开启一个terminal : 快捷键 command + t
$ mysql
mysql> use mysql;
mysql> UPDATE user SET authentication_string=PASSWORD('YOUR_NEW_PASSWORD_HERE') WHERE user = 'root';
最后退出终端关闭进程并启动服务(可以手动开启服务)
mysql> exit;
$ sudo service mysqld start


3.具体用法
http://www.cnblogs.com/mr-wid/archive/2013/05/09/3068229.html#d7

你可能感兴趣的:(Mysql)