# MySQL and localhost Help: Can't connect



## jonpb (Jan 4, 2009)

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 (Jan 4, 2009)

Did you install the mySQL package available from mysql.com?

Did you set up the root password initially?


----------



## ksv (Jan 14, 2009)

/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
```


----------

