CentOS下的MySQL 5.1安裝
01
1.下載源碼包
02
wget http://mysql.llarian.net/Downloads/MySQL-5.1/mysql-5.1.63.tar.gz
03
2.解壓
04
tar zvxf ./mysql-5.1.63.tar.gz
05
3.配置configure
06
./configure --prefix=/usr/local/mysql
07 www.2cto.com
--with-charset=utf8
08
--with-extra-charsets=all
09
--with-tcp-port=3306
10
--with-unix-socket-path=/tmp/mysql.sock
11
--with-mysqld-user=mysqld
12
--with-federated-storage-engine
13
--with-mysqld-user=mysqld
14
--with-plugins=innobase,myisam
15
--enable-assembler
16
--without-isam
17
--with-client-ldflags=-all-static
18
19
{
20
出現checking for termcap functions library... configure: error: No curses/termcap library found
21
curses/termcap 庫沒有安裝
22
下載wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
23
解壓 tar zxvf ncurses-5.9.tar.gz
24
進入目錄 sudo ./configure --prefix=/usr --with-shared --without-debug
25
編譯,安裝 make , make install
26 www.2cto.com
}
27
4.編譯,安裝
28
make
29
make install
30
5.創建用戶和組.配置
31
groupadd mysql
32
useradd -g mysql mysql
33
cp support-files/my-media.cnf /etc/my.cnf
34
mkdir /usr/local/mysql/var
35
36
修改MySQL 數據目錄的 ownership
37
chown -R mysql /usr/local/mysql /usr/lib/mysql /usr/share/mysql
38
chgrp -R mysql /usr/local/mysql /usr/lib/mysql /usr/share/mysql
39
www.2cto.com
40
6.安裝,啟動,進入數據庫.
41
/usr/local/mysql/bin/mysql_install_db
42
/user/local/mysql/bin/mysqld_safe
43
/user/local/mysql/bin/mysql -u root
44
7.添加啟動項
45
mv /usr/local/mysqlshare/mysql/mysql.server /etc/init.d/mysql
46
chmod 775 /etc/init.d/mysql
47
chkconfig --add mysql
作者 foggy