This forum is no longer active. Please post your questions to our new community site

mysql2 error and database.yml file

Subscribe to mysql2 error and database.yml file 4 post(s), 2 voice(s)

Avatar moo 4 post(s)

I thought I would post this because I ran into this problem today and it took quite a number of uninstall/reinstalls to figure it out. IANAC (I’m not a coder/backend developer).

In a nutshell, I was creating a project with Rails3 stack and trying to connect to a MySQL database. I kept getting “Access denied” errors despite checking and rechecking the database, the user privileges, etc.

Finally, I discovered it was the socket in the database.yml file. It was automatically created to point to /tmp/mysql.sock, but after I changed it to /Bitnami_installation_directory/rubystack/mysql/tmp/mysql.sock, happiness ensued.

Would think that this would be automated by the rails new generator in the stack. Took me several hours to figure out, so I hope this helps some other newbie.

Avatar moo 4 post(s)

Oh, and I should point out that when the rubystack installer creates a test project, it uses this directory for the socket in the database.yml file.

However, after, when you use the rubyconsole to create a new project, it uses /tmp/mysql.sock.

This just seems odd to me. Can this be fixed?

Avatar Beltrán Rueda Administrator 3,714 post(s)


Thanks for reporting it. We will document this issue and we will try to find a solution to fix it.