Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How I can install mysql in ubuntu 12.04(gnome 3). So that I will have my mysql installation in /usr/bin/mysql

It's library and header files in /usr/lib/mysql and /usr/include/mysql respectively.

Last time I tried sudo apt-get install mysql-server mysql-client mysql-common The mysql has been installed in /usr/bin/mysql. It's header files were in /usr/include/mysql but library files were not present. and was in /usr/lib/i386-linux-gnu/ which should not be there. I need it to be in /usr/lib/mysql

Help me out in solving this problem :(

share|improve this question
up vote 5 down vote accepted

You could use a .tar.gz download from MySQL's homepage and extract the files to the proper folder, but for greater updateability, using the package manager (apt-get) is more recommended.

Use symbolical links instead

You can create symbolical links with the command ln, so that you will access the files from both directories.

How to create the symbolical link?

The command is used as follows: ln -s target_file link_name. Creating a symlink for will look like this:

codeartist@computer:/usr/lib/mysql$ sudo ln -s /usr/lib/i386-linux-gnu/

This way, opening the file /usr/lib/mysql/ will open the file at /usr/lib/i386-linux-gnu/ Be careful, because if you delete the target file (at i386-..., the symbolical link will be broken.

share|improve this answer
Thanks! But is there any way do the installation using apt-get – codeartist Jun 2 '12 at 11:04
@codeartist Yes, you already mentioned you used sudo apt-get install mysql-server mysql-client mysql-common to do it. My solution of using the symbolical links are to be used after the package has been installed. – Whisperity Jun 2 '12 at 11:08
Okay then I will try it now! :) – codeartist Jun 2 '12 at 11:12
Thanks! It worked :) – codeartist Jul 5 '13 at 3:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.