Access denied or permission denied

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
univers
Forum Newbie
Posts: 10
Joined: Mon Dec 02, 2002 12:19 am
Location: Quebec city, Canada

Access denied or permission denied

Post by univers »

HI,

I think I might have screwed up my DB real bad.

I had no problem installing my MySQL DB.

I then installed PHPmyadmin and everything was super...

But after a while, I got tired of seing the message in red warning me that I had to set up a password for the root@localhost user.

When I installed MySQL for the first time, I had this welcome text in the terminal (MAC OS 10.2.3) :
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h john-does-Computer.local. password 'new-password'
and I entered the first line, but, my mistake might have been to actually write my new password between '' and I replaced : 'new_password' with the password I wanted.

Then I tried the other line and I got access denied or permission denied error since then...

I spent all day looking for answers in this forum (it seems that many people have had this problem) but I found no real solution. Then I spent a lot of time in the MySQL manual... No answer either. I tried many commands and I always got permission denied errors.

PHPmyadmin returned this error:
Error
MySQL said:
Access denied for user: 'root@localhost' (Using password: YES)
From this point, I tried to reinstall MySQL, apparently it worked. but It didn't overwrite the corrupted file... Since My DB was quite empty, I don't mind installing it again, but How can I make sure that it erases everything...

Sorry if this message is long... But I really tried many things before I deceided to post. Your help is appreciated

Thanks
User avatar
James Pelow
Site Admin
Posts: 51
Joined: Sat Jun 01, 2002 5:28 am
Location: Killiney, Co. Dublin, Ireland
Contact:

Post by James Pelow »

While in the finder press (on your keyboard) Shift-Apple-G. In the box that comes up type the path to your MySQL directory - Usually this will be /usr/local/mysql. Then delete the "data" folder. You may need to use the terminal and sudo to do this. Once that has deleted run the DB install script again.

-James
User avatar
univers
Forum Newbie
Posts: 10
Joined: Mon Dec 02, 2002 12:19 am
Location: Quebec city, Canada

Post by univers »

Hey James,

please forgive this obviously newbie question but what is the syntax to delete a file from the terminal?

I reckon I have to be in /usr/local/mysql directory so I beleive I would have to use cd /usr/local/mysql and then something... But what? I'm not even close to have a clue of what it could be... :wink:

Again your help is really appreciated :)

Thanks M8
User avatar
James Pelow
Site Admin
Posts: 51
Joined: Sat Jun 01, 2002 5:28 am
Location: Killiney, Co. Dublin, Ireland
Contact:

Post by James Pelow »

sudo rm -r [File Name]

(Without [])

this deletes a file or folder.

-James
Post Reply