Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I downloaded the Mysql-5.6.12 source code from the official website and extracted its contents in /usr/lib but the problem Im facing is now how do I install it?

I followed the steps to install it it was like

shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data

Next command is optional

shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &

Next command is optional

shell> cp support-files/mysql.server /etc/init.d/mysql.server

But the problem Im facing is:

  shell>/scripts/mysql_install_db 

there is no file named mysql_install_db but has a filenamed

/scripts/mysql_secure_installation.pl.in

Can anyone suggest me how to install Mysql in my ubuntu 12.04. Please help. I have tried other steps as well but nothing seems to work.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

The official instructions for building and installing from source are:

# Preconfiguration setup
shell> groupadd mysql
shell> useradd -r -g mysql mysql
# Beginning of source-build specific instructions
shell> tar zxvf mysql-VERSION.tar.gz
shell> cd mysql-VERSION
shell> cmake .
shell> make
shell> make install
# End of source-build specific instructions
# Postinstallation setup
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server

Source: Installing MySQL Using a Standard Source Distribution

In your question, you don't mention having run cmake ., make or make install at any point.

I suggest you delete your existing directory and start again from the .tar.gz file following the official instructions to the letter.

share|improve this answer
    
Thanks David I will give it a try. While running cmake it gave dependency for curses library does that mean I will have to install ncurses? –  Tarun Jun 18 '13 at 13:13
1  
Yes, I think so. You can run apt-get build-dep mysql-server to install the build dependencies for the Ubuntu source package for MySQL. You are building from source downloaded direct from MySQL so the dependencies might not be the same, but it is likely that this will give you all that you need. –  David Edwards Jun 18 '13 at 13:28
    
I used the above steps as you mentioned and the steps got completed but Im now stuck with a different prob in the code above where it says to shell> cp support-files/my-medium.cnf /etc/my.cnf , whereas there is no file name my-medium.cnf in support-files. plz help. –  Tarun Jun 18 '13 at 14:14
    
/etc/my.cnf is the main MySQL server configuration file. The instructions say this step is optional, but I don't know if the server will start up without one. I don't know why the file is not there; maybe there is another .cnf file in the directory you can use instead? (eg, my-default.cnf). Alternatively, you can create your own config file from scratch. –  David Edwards Jun 18 '13 at 14:33
    
Ya. my-default.cnf is there. Thanks. When I try to start mysql > /etc/init.d/mysql.server start it gives error like The server quit without updating the PID file (/usr/local/mysql/data/tarun-apache.pid) any idea? –  Tarun Jun 18 '13 at 14:36
show 1 more comment

Your Answer

 
discard

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.