Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am new to mySQL and had downloaded it to my computer (mac os X 10.7 lion). I also downloaded SQLpro. I am trying to access a database I have on my computer and am having trouble. I try and type in the database name to open it and get this error:

Access denied for user ''@'localhost' to database 'name'

I have tried logging in as root and I also get the same error except the username is 'root'@'localhost'

I tried deleting mysql from the /usr/local folder and reinstalling it and I am getting the same error. Also, after deleting it, the program I run can not find the database. So I assume the database I used to have is gone.

share|improve this question

migrated from stackoverflow.com Nov 4 '11 at 4:30

This question came from our site for professional and enthusiast programmers.

    
can you provide more information. How are you accessing this. Via cmd on terminal, php code, etc... May I recommend xampp, this way you can connect to your Database via a graphical user interface download xammp access phpmyadmin gui –  Joubin Nov 3 '11 at 17:46
    
I am connecting using mysql via terminal on a mac running mac os x 10.7 lion. I also tried using SequalPro but get the same error. I am using it with a java program. –  user972276 Nov 3 '11 at 19:02

1 Answer 1

Here is how I access MySQL from my Linux server which in the grand scheme of things should be no different than doing it from OS X

From Command Line, I have OS X at home and I have setup my root access so I would SU to do this. On my Linux server I use SUDO
mysql -u"user"(I would use the root user) -p

then from there run the show database command
mysql> show databases;
Then chose the database you want to use
mysql> use "databasename";

Then go from there.

Hope this helps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.