Debian6.02 (squeeze) to compile and install MySQL5.5. For more information, see.
Debian 6.02 (squeeze) to compile and install MySQL 5.5. For more information, see.
Environment: Debian 6.02 (squeeze) x64
Software: MySQL 5.5.14
Steps:
1. upgrade the system
# Apt-get update
# Apt-get upgrade
# Apt-get install chkconfig libpcre3-dev build-essential libssl-dev libncurses5-dev (bison)
2. Prepare Software
Cmake-2.8.5, mysql 5.5.14.
# Wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
# Wget ftp://mirror.anl.gov/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.14.tar.gz
3. Installation
1) install cmake
# Tar zxvf cmake-2.8.5.tar.gz
# Cd cmake-2.8.5/
#./Configure
# Make & make install
2) Add a mysql user
Groupadd mysql
Useradd -- shell/sbin/nologin-g mysql
3) install mysql
# Tar zxvf mysql-5.5.14.tar.gz
# Cd mysql-5.5.14
# Cmake \
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DMYSQL_DATADIR =/usr/local/data/mysql \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DEXTRA_CHARSETS = all \
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_READLINE = 1 \
-DENABLED_LOCAL_INFILE = 1 \
-DMYSQL_TCP_PORT = 3306
# Make & make install
4) change the permission of the installation folder
# Chown-R mysql: mysql/usr/local/mysql/
# Chown-R mysql: mysql/usr/local/data/mysql
5) initialization
# Sh scripts/mysql_install_db -- basedir =/usr/local/mysql/-- datadir =/usr/local/data/mysql -- user = mysql
6) copy the mysql configuration file and generate a STARTUP script
# Cp support-files/my-medium.cnf/etc/my. cnf
# Cp support-files/mysql. server/etc/init. d/mysqld
7) set auto-start
# Chmod 755/etc/init. d/mysqld
# Chkconfig mysqld on
8) set Environment Variables
# Nano/etc/profile
Add the following content
Export PATH =/usr/local/mysql/bin: $ PATH
Alias mysql_start = "mysqld_safe &"
Alias mysql_stop = "mysqladmin-u root-p shutdown"
4. Start the test
# Service mysqld start
#/Usr/local/mysql/bin/mysql-uroot-p
5. Password and Security Configuration
#/Usr/mysql/bin/mysql_secure_installation