0

I'm trying to install mysql in ubuntu to run ruby on rails. I was going through the tutorial at Lynda. I have successfully installed ruby, gem & rails.

ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

gem -v
1.8.15

rails -v
Rails 2.3.14

Now, I am trying to install mysql. To do this, the tutorial asks to update the .profile file by adding a line.

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

I added the following line to it:

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

I exited the terminal & opened a new instance. & when I do:

echo $PATH

It gives me:

/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

mysql isn't coming up in the path.

To install mysql, I did:

sudo apt-get install mysql-client-core-5.5

& I can see that mysql is installed:

which mysql
/usr/bin/mysql

But I cannot see mysql version:

mysql -v
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

What do I need to do install mysql. Will solving this error allow me to access mysql from the terminal or do I need to do anything else as well?

1
  • .profile is read when you log in, not when you open a terminal.
    – geirha
    Apr 8, 2013 at 13:40

1 Answer 1

0

MySQL has a client/server architecture. You now need to install the server -- not just tools that allow you to talk to it. It will probably have a name like 'mysql-server', so do "sudo apt-get install mysql-server".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .