Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to get to know Django (my first attempts at a framework, or any backend work for that matter), and I'm seriously stumped by MySQL, and SQL in general.

I'm trying to create a new database and I get:

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'dbname'

So I've tried the advice here: Access denied for user localhost

Which might work, but using: mysql -uroot -p I can't seem to remember my password. I don't recall setting one, but leaving it blank doesn't work either.

Also, I have to run mysql using:

/Applications/MAMP/Library/bin/mysql

Because:

mysql

results in:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I'm guessing that's related to the error above, right?

I'm in a right mess here, SQL and the command line intimidate the heck out of me and it seems so easy to break stuff. If anyone could offer some pointers that would be great.

share|improve this question
    
There must be config to set user and password to database connection. Message simply says that there is no authorized access granted. –  Jirka KopÅ™iva Aug 16 '13 at 10:35
2  
Try just /Applications/MAMP/Library/bin/mysql -u root without the -p, just in case you don't have a password. –  Joachim Isaksson Aug 16 '13 at 10:39
4  
Show me proof of your pulled hair. Attach the image. –  Tim Tom Aug 16 '13 at 10:45
    
That works, Joachim, thanks. Do I always need to start MySQL as the root user? Is there a way to set it up so I can just type mysql and it start up with access automatically? –  Tom Ellis Aug 16 '13 at 10:46
    
Oh. Now it's not displaying the "Access Denied" error just running mysql -u root. –  Tom Ellis Aug 16 '13 at 10:52
show 2 more comments

migrated from stackoverflow.com Aug 16 '13 at 21:21

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

Your Answer

 
discard

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