Posts Tagged ‘mysql’

Installing mysql on Mac Snow Leopard

Posted in Uncategorized on September 18th, 2009 by ph-lee – 2 Comments

This articles is regarding Mac OS X 10.6 with mysql 5.1.37.

I followed this article at hivelogic.com which required compiling mysql from source. It mostly worked with a few hitches which I’d like to share.

After following the article and attempting to run my rails app the first problem I hit was…

uninitialized constant MysqlCompat::MysqlRes

this problem seemed to be that you need to specify the atchitecture as 64-bit when installing the mysql gem. So run the below command intead when install the mysql gem…

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-
config=/usr/local/mysql/bin/mysql_config

Or if you already installed the gem just re-install with this command. The next problem was the following…

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I’d move a project from ubuntu onto the mac I couldn’t find the mysql socket to use as it was specifying the wrong location. On the mac the file can be found at

/tmp/mysql.sock

So you’ll need to modify your database.yml file accordingly to point to this location

Hope this helps.

Gotcha : Mysql::Error: Unknown database 'application_name_test' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'

Posted in Uncategorized on July 19th, 2009 by ph-lee – Be the first to comment

After dealing with thisGotcha : Mysql::Error: Access denied for user ‘root’@’localhost’ you’ve hit another problem of…

This means rails is looking for the test database but can’t find it cause it’s not there. Simply got to mysql Query Browser or command line, whichever you prefer and create a new database/schema of your application_name followed by _test so for example

my_app_test

Theres no need to copy/clone the database structure a across. Rails will replicate the development database as the test database.

Gotcha : Mysql::Error: Access denied for user 'root'@'localhost' (using password: NO) /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'

Posted in Uncategorized on July 19th, 2009 by ph-lee – 1 Comment

So you decided to run some tests on your new rails project and this error crops up…

Looks like you forget to configure the test database parameters in the configuration/database.yml file.

Troubleshooting : gem install mysql on Ubuntu

Posted in Uncategorized on June 6th, 2009 by ph-lee – 1 Comment

Whilst deploying a VirtualBox of Ubuntu to act as a Ruby on Rails development server I hit several issues. One of which was installing the mysql gem with the command

sudo gem install mysql

Giving me the error of

With some googling I found the solution at mentalized.net needing to install ruby1.8-dev as it was missing in my case. To solve enter the following command…

sudo apt-get install ruby1.8-dev

That solved one problem but I hit another trying to install the mysql gem.

This one took more googling but eventually found codeweblog giving a solution. Again I was missing further dependent libraries in this case libmysqlclient15-dev. To install that enter the command…

sudo apt-get install libmysqlclient15-dev

Installing the mysql gem should now work.

Hope this helps.