我正在经历非常简单的MySQL安装,并且一直遇到无数错误。
我下载了mac社区服务器mac here(DMG文件)
安装完成后,我获得了root@localhost
生成的密码。
然后我在.bash_profile
目录中创建了一个~/
文件,并将该行放入其中:
export PATH=$PATH:/usr/local/mysql/bin
然后我重新启动终端并运行命令mysqladmin -u root -p password
,然后询问我的密码,我输入了它给我的密码,然后给了我错误:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
运行mysqld
给了我:
mysqld: Can't change dir to '/usr/local/mysql-5.7.21-macos10.13-x86_64/data/' (Errcode: 13 - Permission denied)
2018-01-23T20:06:55.928536Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-01-23T20:06:55.928877Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-01-23T20:06:55.928927Z 0 [Note] mysqld (mysqld 5.7.21) starting as process 2312 ...
2018-01-23T20:06:55.932415Z 0 [Warning] Can't create test file /usr/local/mysql-5.7.21-macos10.13-x86_64/data/GBMAC0003.lower-test
2018-01-23T20:06:55.932448Z 0 [Warning] Can't create test file /usr/local/mysql-5.7.21-macos10.13-x86_64/data/GBMAC0003.lower-test
2018-01-23T20:06:55.932582Z 0 [ERROR] failed to set datadir to /usr/local/mysql-5.7.21-macos10.13-x86_64/data/
2018-01-23T20:06:55.932591Z 0 [ERROR] Aborting
2018-01-23T20:06:55.932602Z 0 [Note] Binlog end
2018-01-23T20:06:55.932672Z 0 [Note] mysqld: Shutdown complete
我已尝试转到/data/
文件夹并更改权限,但每次运行mysqld
时,它都会告诉我它没有其他文件的其他权限目录中的文件夹...最终导致我陷入错误的兔子洞等。
在我的系统偏好设置中,单击MySQL会出现错误
Preferences Error
Could not load MySQL preferences pane
之前我已经下载了mysql并且它更直接但是出于某种原因我这次遇到了问题。我已尝试卸载并重新安装所有相同的问题
我还尝试下载SequelPro,通过GUI使用生成的密码登录root @ localhost,我仍然遇到访问错误
答案 0 :(得分:0)
我很生气,因为这没有任何意义,但我尝试通过brew卸载并重新安装,现在一切正常......