Debian6.02 (squeeze) compilation and installation of MySQL5.5 _ MySQL

Source: Internet
Author: User
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

1 #apt-get update
2
3 #apt-get upgrade
4
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
2
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
3 #cd cmake-2.8.5/
4
5 #./configure
6
7 #make && make install

2) add a mysql User

1 groupadd mysql
2
3 useradd --shell /sbin/nologin -g mysql mysql

3) install mysql

01 #tar zxvf mysql-5.5.14.tar.gz
02
03 #cd mysql-5.5.14
04
05 #cmake /
06
07 -DCMAKE_INSTALL_PREFIX=/usr/local/mysql /
08
09 -DMYSQL_DATADIR=/usr/local/data/mysql /
10
11 -DDEFAULT_CHARSET=utf8 /
12
13 -DDEFAULT_COLLATION=utf8_general_ci /
14
15 -DEXTRA_CHARSETS=all /
16
17 -DWITH_MYISAM_STORAGE_ENGINE=1 /
18
19 -DWITH_INNOBASE_STORAGE_ENGINE=1 /
20
21 -DWITH_READLINE=1 /
22
23 -DENABLED_LOCAL_INFILE=1 /
24
25 -DMYSQL_TCP_PORT=3306
26
27 #make && make install

4) Change the permission of the installation folder

1 #chown -R mysql:mysql /usr/local/mysql/
2
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
2
3 #cp support-files/mysql.server /etc/init.d/mysqld

7) set auto-start

1 #chmod 755 /etc/init.d/mysqld
2
3 #chkconfig mysqld on

8) set environment variables

1 #nano /etc/profile

Add the following content

1 export PATH=/usr/local/mysql/bin:$PATH
2
3 alias mysql_start="mysqld_safe &"
4
5 alias mysql_stop="mysqladmin –u root -p shutdown"

4. start the test

1 #service mysqld start
2
3 #/usr/local/mysql/bin/mysql -uroot –p

5. password and security configuration

1 #/usr/mysql/bin/mysql_secure_installation
BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.