Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'./mysql/user.MYD' not found (Errcode: 13 - Permission denied)

Tags:

mysql

macos

I am trying to do a fresh install of Mac OSX LAMP and running the command

mysql_secure_installation

I have inputting the root password and I have to now input a new password when I'm hit with this error, has anyone got any experience with this?

Re-enter new password:
 ... Failed! Error: File './mysql/user.MYD' not found (Errcode: 13 - Permission denied)
like image 404
GrahamMorbyDev Avatar asked Sep 14 '17 08:09

GrahamMorbyDev


1 Answers

Please retry to completely remove mysql by executing:

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*

And then restart your computer to make sure that all the processes have been killed.

Then execute these commands to install 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

This should do the trick.

like image 61
dkiriakakis Avatar answered Nov 01 '22 23:11

dkiriakakis