I spent two days installing the mysql5 in the debian3.1. It’s a painful process.
At first, I used the command apt-get install mysql to install the mysql server. When it’s done, I found the version of mysql is 4.0. I typed the command apt-cache search mysql and I found the mysql package is really 4.0. I should not use the mysql4 because mysql4 can’t support the varchar(1024), it only support the varchar(255). I have coded my current project with varchar(1024) and I have no privilege to change the interface. I must reinstall mysql and I should install the mysql5 to conform to the interface.
Secondly, I tried to compile the mysql5 source codes. Unfortunately, I encountered several fatal errors. I tried to fix the errors, but it’s failed.
Thirdly, I searched the libmysqlclient15-dev_5.0.45-0.dotdeb.0_i386.deb package in the internet. I installed it and I couldn’t find the mysql command.
Fourthly, I downloaded the mysql-5.0.45-linux-i686-glibc23.tar.gz package from the mysql authoritative website. I uncompress it and it’s finally ok. MYSQL is an opened sources project and it can work in many platforms. We can copy the binary executable files to satisfy our needs.
I’ll record the steps here to share with all of you.
tar zxvf mysql-5.0.45-linux-i686-glibc23.tar.gz
ln –s mysql-5.0.45-linux-i686-glibc23 mysql
chown –R mysql.mysql mysqlInstallPath
mysql-install-db –user=mysql
chown –R mysql data
mysqlInstallPath/bin/mysqld-safe –user=mysql &
I tried another method to install mysql5 in debian3 and I installed it successfully. I downloaded another mysql5 source codes and compiled it successfully. However, I didn’t configure the installation process and forgot the Chinese characters. I recompiled it and installed it again. Finally, I finished mysql5 installation.
./configure --prefix=/usr/local/mysql --with-extra-charsets=gbk,gb2312 && make && make install
Congratulations! Oh. MY GOD!