您的位置:首页 > 博客中心 > 数据库 >

mac下修改mysql-root密码-各种权限问题解决

时间:2022-03-10 18:14

官方资料: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密码无修改权限,各种无权限


解决的办法就是

UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass‘)
    ->                   WHERE User=‘root‘;

然后再进入就ok了





mac下修改mysql-root密码-各种权限问题解决,布布扣,bubuko.com

热门排行

今日推荐

热门手游