mac下修改mysql连接数_mac下修改mysql

官方资料:http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix 还有一个得参考的mysql安装,与python-mysql安装博客http://hearrain.com/2011/01/498 据官方文档说, For example, if you run the server usin

官方资料:http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix

还有一个值得参考的mysql安装,与python-mysql安装博客http://hearrain.com/2011/01/498

据官方文档说,

For example, if you run the server using the mysql login account, you should log in as mysql before using the instructions. Alternatively, you can log in as root, but in this case you must start mysqld with the --user=mysql option. If you start the server as root without using --user=mysql, the server may create root-owned files in the data directory, such as log files, and these may cause permission-related problems for future server startups.

如果在安装完mysql后,当你用root登录的时候,必须加上--user=mysql,否则的话,服务器会自动创建root-owned文件,这些就会导致权限的问题

我之前就是因为直接登录了,然后root密码无修改权限,各种无权限

解决的办法就是

shell> kill `cat /mysql-data-directory/host_name.pid`

mysql-data-directory 的路径一般是 /usr/local/mysql/data下的包含你的电脑名称的以pid结尾的文件

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';

FLUSH PRIVILEGES;

结束进程之后,把上面的两句话放到一个文件中例如update_passwd,该文件在/usr/local/下

shell> mysqld_safe --init-file=/home/me/mysql-init &

然后sudo su进入root权限,进入mysql下bin输入以上命令,结束后(我的好像没有结束,就另开了一个terminal),

进入mysql命令行下

UPDATE mysql.user SET Password=PASSWORD('MyNewPass')

-> WHERE User='root';

然后再进入就ok了

f68f2add0b68e4f9810432fce46917b7.png

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值