Debian6.02 (squeeze) compilation and installation of MySQL5.5 debian
BitsCN.com
Environment: Debian 6.02 (squeeze) x64
Software: MySQL 5.5.14
Steps:
1. upgrade the system
5 |
#apt-get install chkconfig libpcre3-dev build-essential libssl-dev libncurses5-dev bison |
2. prepare software
Cmake-2.8.5, mysql 5.5.14.
1 |
#wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz |
3 |
#wget ftp://mirror.anl.gov/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.14.tar.gz |
3. Installation
1) install cmake
1 |
#tar zxvf cmake-2.8.5.tar.gz |
2) add a mysql User
3 |
useradd --shell /sbin/nologin -g mysql mysql |
3) install mysql
01 |
#tar zxvf mysql-5.5.14.tar.gz |
07 |
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql / |
09 |
-DMYSQL_DATADIR=/usr/local/data/mysql / |
11 |
-DDEFAULT_CHARSET=utf8 / |
13 |
-DDEFAULT_COLLATION=utf8_general_ci / |
15 |
-DEXTRA_CHARSETS=all / |
17 |
-DWITH_MYISAM_STORAGE_ENGINE=1 / |
19 |
-DWITH_INNOBASE_STORAGE_ENGINE=1 / |
23 |
-DENABLED_LOCAL_INFILE=1 / |
4) Change the permission of the installation folder
1 |
#chown -R mysql:mysql /usr/local/mysql/ |
3 |
#chown -R mysql:mysql /usr/local/data/mysql |
5) Initialization
1 |
#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
1 |
#cp support-files/my-medium.cnf /etc/my.cnf |
3 |
#cp support-files/mysql.server /etc/init.d/mysqld |
7) set auto-start
1 |
#chmod 755 /etc/init.d/mysqld |
8) set environment variables
Add the following content
1 |
export PATH=/usr/local/mysql/bin:$PATH |
3 |
alias mysql_start="mysqld_safe &" |
5 |
alias mysql_stop="mysqladmin –u root -p shutdown" |
4. start the test
3 |
#/usr/local/mysql/bin/mysql -uroot –p |
5. password and security configuration
1 |
#/usr/mysql/bin/mysql_secure_installation |
BitsCN.com