Ubuntu – Installing thesql 5.1 with Ubuntu 12.04

12.04MySQLrpm

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?

Best Answer

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.