# Slightly OT, Issue with mysql 5.0 and root password

**URL:** <https://www.ruby-forum.com/t/slightly-ot-issue-with-mysql-5-0-and-root-password/129441>\
**Category:** Rails\
**Created:** [February 18, 2008, 5:43pm UTC](https://www.ruby-forum.com/t/slightly-ot-issue-with-mysql-5-0-and-root-password/129441 "2008-02-18T17:43:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rykkers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e5b9ba/32.png) [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Post date:** [February 18, 2008, 5:43pm UTC](https://www.ruby-forum.com/t/slightly-ot-issue-with-mysql-5-0-and-root-password/129441/1 "2008-02-18T17:43:51Z")

</div>

Since upgrading my MacBook to leopard I’ve been experiencing a  
frustrating issue with MySQL.

I installed rb-mysql using macports, which installed mysql 5 as well.

The problem is that unlike before I can’t get into mysql as the root  
user without explicitly providing a root password, even though the  
root password is empty.

Macintosh:test rick$ mysql5 -u root  
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using  
password: YES)  
Macintosh:test rick$ mysql5 -u root -p  
Enter password:  
Welcome to the MySQL monitor. Commands end with ; or \g.  
Your MySQL connection id is 19  
Server version: 5.0.51 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql\>

Since this is a development only machine, I really want to have an  
empty root mysql password. Before, logging in as root worked with no  
-p option.

This issue seems to be wreaking havoc with my ability to run Rails  
regression tests.

Has anyone seen this and have any insight as to how to get MySQL 5 to  
work without prompting for a blank password?

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![rykkers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e5b9ba/32.png) [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Post date:** [February 19, 2008, 2:23am UTC](https://www.ruby-forum.com/t/slightly-ot-issue-with-mysql-5-0-and-root-password/129441/2 "2008-02-19T02:23:29Z")

</div>

> The problem is that unlike before I can’t get into mysql as the root  
> user without explicitly providing a root password, even though the  
> root password is empty.
> 
> Macintosh:test rick$ mysql5 -u root  
> ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using  
> password: YES)  
> \<…\>

Looks like wrong password is provided even if you don’t specify it.  
Can you check MySQL configuration files, maybe macports installer put  
options into it? Look for /etc/my.cnf, ~/.my.cnf, $MYSQL\_HOME/my.cnf  
if you see something like:

[client]  
user = root  
password = sometpass

that may be it.

## Regards, Rimantas

[http://rimantas.com/](http://rimantas.com/)

---

<div class="post-metadata">

**Author:** ![rykkers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e5b9ba/32.png) [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Post date:** [February 19, 2008, 3:34am UTC](https://www.ruby-forum.com/t/slightly-ot-issue-with-mysql-5-0-and-root-password/129441/3 "2008-02-19T03:34:58Z")

</div>

On Feb 18, 2008 8:22 PM, Rimantas L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Looks like wrong password is provided even if you don’t specify it.  
> Can you check MySQL configuration files, maybe macports installer put  
> options into it? Look for /etc/my.cnf, ~/.my.cnf, $MYSQL\_HOME/my.cnf  
> if you see something like:
> 
> [client]  
> user = root  
> password = sometpass
> 
> that may be it.

Thanks, that was basically it. I figured it out earlier today.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
