small medium large xlarge

14 Jun 2009, 23:29
Mike Varela (1 post)

Having a heck of a time getting my rails to talk with Mysql.

I’m using Rails 2.3.2 Ruby 1.8.7 Mysql 5.1.35

I’ve successfully installed all three. (note that your book doesn’t cover installation very well, not detailed enough, i.e. creating a src directory, working with PATH on mac)

Anyways, I can successfully create the database “newsletter” but when I type mysqlshow I don’t see the database. I think I might be using a database in another location, though when I query which mysql it looks right. below is my info

my path file (.profile)

export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH”

my database.yml file

  adapter: mysql
  encoding: utf8
  reconnect: false
  database: newsletter_development
  pool: 5
  username: root
  socket: /tmp/mysql.sock

and some responses from terminal

Last login: Sun Jun 14 15:40:19 on ttys000
You have new mail.
VarelaMacbook:~ Mike$ which mysql
VarelaMacbook:~ Mike$ mysqlshow
|     Databases      |
| information_schema |
| test               |
VarelaMacbook:~ Mike$ cd newsletter
VarelaMacbook:newsletter Mike$ mysqladmin -u root -p create newsletter_development
Enter password: 
mysqladmin: CREATE DATABASE failed; error: 'Can't create database 'newsletter_development'; database exists'
VarelaMacbook:newsletter Mike$ mysqlshow
|     Databases      |
| information_schema |
| test               |
VarelaMacbook:newsletter Mike$ 

So I’m stuck…. any help

15 Jun 2009, 00:08
Mike Naberezny (7 posts)


I noticed that you did not give any connection information to the @mysqlshow@ command. You need to give it the same user and password arguments as you did for @mysqladmin@:

$ mysqladmin -u root -p create newsletter_development

The @mysqlshow@ command would then be:

$ mysqlshow -u root -p


Regards, Mike