Greetings :)

Hi, I'm Louis!
I like to code, but I don't do enough of it.

This blog is about trying my best to keep up with the ever evolving stream of technology.

Thursday, October 4, 2012

Setting up MySQL on ubuntu

Well it doesn't seem like it'd be that difficult... but I have spent a good few hours trying to set it all up!

The first problem was that I didn't know how to install it - should I use apt-get install, or download the .rpm or use the synaptic package installer... I ended up going with apt-get, and there were a couple of other libraries I needed to install as well:

sudo apt-get install mysql-server install mysql-client

Install these if you haven't already:zlib1g, zlib1g-dev, build-essential, openssl, libssl-dev, libmysqlclient-dev, libyaml-dev

I had a bit of a problem however with libmysqlclient-dev... I don't know if this was because I was playing around or what... but it wouldn't install because it said:

Unpacking libmysqlclient-dev (from .../libmysqlclient-dev_5.5.24-0ubuntu0.12.04.1_i386.deb) ... dpkg: error processing /var/cache/apt/archives/libmysqlclient-dev_5.5.24-0ubuntu0.12.04.1_i386.deb (--unpack): trying to overwrite '/usr/bin/mysql_config', which is also in package mysql-devel 5.5.28-2

I got rid of this problem by removing the mysql-devel package:
dpkg -r mysql-devel

I also learnt a cool command to see all mysql related installs:
dpkg --get-selections | grep mysql

I had to say where the mysql socket is for rails to make a connection to mysql. The location I used is /var/run/mysqld/mysqld.sock -which seems to be working fine.

Finally, it comes time to run mysql - which it looks like you can also do in various ways! I've been running it by doing:

service mysql start

There is a blog which probably describes this all in more detail:
http://cicolink.blogspot.co.uk/2011/06/how-to-install-ruby-on-rails-3-with.html





No comments:

Post a Comment