PDA

View Full Version : MySQL and localhost Help: Can't connect


jonpb
January 4th, 2009, 10:15 AM
Hi all,

I've installed MySQL on my Mac (MBP, 10.4.6) using Marc Liyanage instructions. Seems to install, BUT, When I input:

/usr/local/mysql/bin/mysql test

I get:
"ERROR 1045 (28000) Access denied for user 'username' @'localhost' (using password: NO)

I get a 'Command not found' when I type:
mysql -u root -p

There is no mysql prompt in terminal when I start it, only my username...

ANY help would be GREATLY appreciated...

Thanks in advance.

ElDiabloConCaca
January 4th, 2009, 12:10 PM
Did you install the mySQL package available from mysql.com?

Did you set up the root password initially?

ksv
January 14th, 2009, 02:02 PM
/usr/local is not in the default path on OS X, so unless you add it, you need to use specify the whole path of mysql:


/usr/local/mysql/bin/mysql -u root test


If there's a password set for the root user, you need to ask for the password prompt by adding the -p flag:


/usr/local/mysql/bin/mysql -u root -p test