1

I have Ubuntu 12.04 installed, I need to install mysql 5.1 in that. Following steps I performed:

  1. Other things to be installed:
    Run this command to install alien and other necessary packages if not installed:
    sudo apt-get install alien dpkg-dev debhelper build-essential

  2. MySql installation:
    If you have already MySql installed (higher version than 5.1) then uninstall. Extract "MySQL-5.1.73-1.glibc23.i386.rpm-bundle.tar" in same dir. And, Navigate to "MySQL-5.1.73-1.glibc23.i386.rpm-bundle"

    • Issue following command to convert Mysql-server rpm to deb: sudo alien MySQL-server-5.1.73-1.glibc23.i386.rpm

    • Issue following command to convert Mysql-client rpm to deb: sudo alien MySQL-client-5.1.73-1.glibc23.i386.rpm

    • Issue following command to install Mysql-server: sudo dpkg -i mysql-server_5.1.73-2_i386.deb

    • Issue following command to install Mysql-client: sudo dpkg -i mysql-client_5.1.73-2_i386.deb

After the installation I'm getting the following error:

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

After installation mysql.sock file is missing also my.cnf file is also missing.

I had refered the site http://www.howtogeek.com/howto/ubuntu/install-an-rpm-package-on-ubuntu-linux/ for RPM package installation in ubuntu

I need to install a software that is compatable with Mysql 5.1, I had tried to install with MySQl 5.5 i got the following error com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=InnoDB' at line 1

Is there any other way that I can install MySQl 5.1 in Ubuntu 12.04?

3
  • What software is requiring that you install an old version of mysql? Perhaps adding a link (by editing your question) to where you found these instructions would also be helpful.
    – douggro
    Feb 7, 2014 at 14:25
  • @ douggro : Is there any other approach for installing MySQL 5.1 in ubuntu 12.04 ?
    – Rosh
    Feb 10, 2014 at 10:55
  • For 5.1, no - it's no longer maintained in the repositories. You'd have to install from an old .deb or .rpm file like you attempted, or compile from the source code.
    – douggro
    Feb 10, 2014 at 15:42

2 Answers 2

1

Since MySQL 5.1.X is only available in the repositories for 10.04 (Not 12.04), I started searching for others with the same issue. Found a script in github (Thanks kamermans)

Which shows the following:

#!/bin/bash

set -e

cd ~/
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz
tar -zxf mysql-5.1.65.tar.gz
cd mysql-5.1.65
./configure  '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control'
make
sudo make install

Tested the script and it works. It still downloads the 5.1.65 version and configure/makes it. you can also change that to the last 5.1.x version which is 5.1.72 and still works.

I also recommend reading "Can't connect to local MySQL server through" socket error to solve some issues regarding socket problems.

0
0

First you have to start the MySQL server.

service mysqld start 

For Ubuntu:

service mysql start

Type that in your terminal and then type as

mysql -u root -p
2
  • mysqld: unrecognized service That what I got now. Sadly, after all the efforts.
    – I159
    Apr 10, 2014 at 13:59
  • @I159 try with service mysql restart , actually for distros like redhat my above command works. Thanks for notyifing
    – Raja G
    Apr 10, 2014 at 14:28

You must log in to answer this question.

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