' ./ MySQL的/ user.MYD就'未找到(错误代码:13 - 权限被拒绝)

时间:2017-09-14 08:12:24

标签: mysql macos

我正在尝试重新安装Mac OSX LAMP并运行命令

#include <stdio.h>
#include <stdlib.h>

int yylex (void);
void yyerror (char const *);

我输入了root密码,当我遇到此错误时,我必须输入一个新密码,有没有人有这方面的经验?

mysql_secure_installation

2 个答案:

答案 0 :(得分:7)

请执行以下命令重试完全删除mysql:

brew remove mysql
brew cleanup
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*

然后重新启动计算机以确保所有进程都已被终止。

然后执行这些命令来安装MySQL:

brew update
brew install mysql
unset TMPDIR
mysql_install_db --verbose --user='<your-username>' --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start

这应该可以解决问题。

答案 1 :(得分:0)

我认为安装中存在损坏,并决定删除并使用brew进行安装,现在一切都很好!请按照以下步骤操作

打开终端窗口 使用mysqldump将数据库备份到文本文件! 停止数据库服务器

0000000109300000000128ee3cb00000000106010700000302000003000480000001219a023f50412166342051000cf461669d028ca88a7b5d4ea2b199d42a448806e7efc39b27bf678be058061f3b0559b683699173d709c8667028c4a3929a3a5a61c772faee300bbabfcbe8a511bc6d2c0e617db9edeb64cf62e1770491aab49ad213da7017e2fdab1527767cb58585eabdb7011fe8e1245caf8a65a2a3bff9390f871bf141db99820936eeaad5c705434dfc2ec273776c3a65fc115432867d171a43681e55c89b6039c3e8d8e22124629b71432b1d9b99a4afd094aeab121aba7cc4edf8fa34c8e1871b8b3c82438ece2024c1832e76600622f0829d9826be6727d5751c005ee6bd0fb626df426aab54c672eff36e357af8c1011ea573cc8cb743fa089ca73d65d5551362dd3f5cb7fe71039e7cb2c2afd43477c3eeba89a96b6b95a0357a6cca97f12b798dba47b90241f8f05f26a053920df20e9f4059f38ddaad7e8b55747dcdf2aadab61e1327ed829eceb74f744de3c8d60bf9de416e76f501366638a4fdeb8b3900b88d0dbfdf994b3ed227a8f17b795949e272cf601e5c3dac630499dd86d2b22a4df2ab7e071236155158dd2c0156fb556c94ac04ebca725eb8539be68c6db80e548b0f557e3d045233b36c5d375e2a7d03db787b697c2b15f97e1cd579e38ce42221afdc0fafc0790a1e01f54ea9a40397d72c99dac3780bff781f0702b1a5631fc8898a2b8130a80f0727d24c3da8

然后通过Brew安装

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*