Skip to content

Create Databases for Rails with MySQL

November 27, 2010

Want to use Rails with MySQL ? You will have to create the right databases. Here is what I the book recommends:

shell>mysqladmin -u root create database_name


shell>mysqladmin -u root -p create database_name

and give the password

or try this

shell> rake db:create

check this

(it just creates the databases required for the rails applcations, both develoment and test. does not need the name. it it is a rails thing. it takes it from the database.yml file. )

Before looking at the book, this is what I found, which, fyi,  I now find unnecessary

Note: I am not using password. So what I did is:

mysql> create database database_name;
Query OK, 1 row affected (0.01 sec)

mysql> grant all privileges on database_name.*
to 'root'@'localhost';
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: