Saari Development

Ali Rizvi's Technical Blog as a Professional Software Development Engineer

MySQL and Rails: mysql.sock not found

leave a comment »

I started doing my webapp on my brand new server (ubuntu linux 7.04) and when trying to run my first migration I got the following error message:

rake db:migrate
(in /home/rizvi/projects/somewebapp)
rake aborted!
No such file or directory - /tmp/mysql.sock

Here is a useful mysql command to find out mysql defaults:

mysqladmin --print-defaults
mysqladmin would have been started with the following arguments:
--port=3306 --socket=/var/run/mysqld/mysqld.sock

Here is what solved the problem:

sudo apt-get install libmysql-ruby

Note: The above is an alternative to :

sudo gem install mysql

Now I get:

rake db:migrate
(in /home/rizvi/projects/somewebapp)
rake aborted!
Unknown database 'somewebapp_development'
(See full trace by running task with --trace)

So I need to do the following:

mysqladmin -u root create somewebapp_development -p
mysqladmin -u root create somewebapp_test -p
mysqladmin -u root create somewebapp_production -p

Reference: RailsOnUbuntu


Written by imsaar

August 6, 2007 at 6:37 am

Posted in mysql, rails

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: