using mamp. I made the apparently common mistake of deleting the root user when creating another user, I was locked out!
so I found this post and tried to follow the directions but...
I was getting this errores:
-bash: mysql: command not found when trying to execute the command mysql commands and later I was getting this error
DELETE command denied to user ''@'localhost' for table 'user' when tring to set properly privileges to the root user and do anything with that user once mysql in shell.
so before I could use the commands eric and rolando posted (thank you guys for that)
this is what I did
I need to start mysqld properly so
I had to do the following
- stop mysqld process found with
ps aux | grep mysql
and stop the mamp interface application aswell..
- and stopped any mysql process found with
kill -9 [pid]
do make sure no mysql process are running before you go any further.
- then I had to restart mysqld properly from the actual location where I had mysql binaries
this commnad will start mysld without asking for a password (sort of like in safemode)
/Applications/MAMP/Library/bin/mysqld --skip-grant-tables --skip-networking &
I tried with my.cnf file but couldn't get it to work.
- then I had to go into mysql in shell
/Applications/MAMP/Library/bin/mysql -u root -p
(if prompted for a password just hit enter)
then execute the commands eric and rolando posted, this time I didnt get any error "DELETE command denied to user ''@'localhost' for table 'user'" if you do, you didn't start mysqld properly
then stop the mysqld service:
/Applications/MAMP/Library/bin/mysqld stop
then restarted mamp as usual with the gui
and all started to work again as it was before... I was so relieved!!!
2 hours of panic and trial and error with the console... valuable lessons learned..
If I messed up any of the commands or the explanation (which could be the case as I was tracing my steps back as writing this post please let me know. I'd be happy to update the post.
lastly don't give. it can be done!!