前言
从mysql5.1.24开始innodb就以plugins形式发布了,最新版本5.1.45安装不能以--with-innodb的形式安装了,必须以插件的方式来安装--with-plugins=innobase
1.下载mysql和innodb
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-
5.1.45.tar.gz/from/http://mysql.cdpa.nsysu.edu.tw/
wget http://www.innodb.com/download/innodb_plugin/innodb_plugin-1.0.6.tar.gz
2.安装mysql和innodb
tar xzvf mysql-5.1.45.tar.gz
cd mysql-5.1.45/storage
tar xzvf innodb_plugin-1.0.6.tar.gz
rm -rf innobase
mv innodb_plugin-1.0.6 innobase
cd ..
HOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
./configure \
"--prefix=/usr/local/mysql" \
"--localstatedir=/usr/local/mysql/data" \
"--with-comment=Test" \
"--with-server-suffix=-XinYing" \
"--with-mysqld-user=mysql" \
"--without-debug" \
"--with-big-tables" \
"--with-charset=utf8" \
"--with-collation=utf8_general_ci" \
"--with-extra-charsets=all" \
"--with-pthread" \
"--with-plugins=innobase" \ # 加载innodb
"--enable-static" \
"--enable-thread-safe-client" \
"--with-client-ldflags=-all-static" \
"--with-mysqld-ldflags=-all-static" \
"--enable-assembler" \
"--without-ndb-debug"
make&&make install
3、mysql初始化配置
cd /usr/local/mysql
mkdir -p /usr/local/mysql/data
useradd mysql -d /dev/null -s /sbin/nologin
chown -R root:mysql .
chown -R mysql /usr/local/mysql/data
/usr/local/mysql/bin/mysql_install_db --user=mysql
cat share/mysql/my-innodb-heavy-4G.cnf | grep -v "#" | grep -v "^$" > /etc/my.cnf
sed -i 's/skip-locking/skip-external-locking/' /etc/my.cnf
sed -i 's/no-auto-rehash/auto-rehash/' /etc/my.cnf
sed -i '/server-id/askip-name-resolve\nlog-error=/var/log/mysqld.log' /etc/my.cnf
echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
/etc/rc.d/init.d/mysqld start
tail /var/log/mysql.log显示如上信息就表示安装成功了
mysqladmin -u root -p password 密码
4.删除多余的用户
mysql -u root -p
mysql>drop user root@127.0.0.1;
mysql>drop user root@localhost.localdomain;
mysql>drop user ''@localhost.localdomain;
mysql>drop user ''@localhost;
参考文档:http://www.innodb.com/doc/innodb_plugin-1.0/innodb-plugin-installation.html#innodb-plugin-installation-source-unix
从mysql5.1.24开始innodb就以plugins形式发布了,最新版本5.1.45安装不能以--with-innodb的形式安装了,必须以插件的方式来安装--with-plugins=innobase
1.下载mysql和innodb
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-
5.1.45.tar.gz/from/http://mysql.cdpa.nsysu.edu.tw/
wget http://www.innodb.com/download/innodb_plugin/innodb_plugin-1.0.6.tar.gz
2.安装mysql和innodb
tar xzvf mysql-5.1.45.tar.gz
cd mysql-5.1.45/storage
tar xzvf innodb_plugin-1.0.6.tar.gz
rm -rf innobase
mv innodb_plugin-1.0.6 innobase
cd ..
HOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
./configure \
"--prefix=/usr/local/mysql" \
"--localstatedir=/usr/local/mysql/data" \
"--with-comment=Test" \
"--with-server-suffix=-XinYing" \
"--with-mysqld-user=mysql" \
"--without-debug" \
"--with-big-tables" \
"--with-charset=utf8" \
"--with-collation=utf8_general_ci" \
"--with-extra-charsets=all" \
"--with-pthread" \
"--with-plugins=innobase" \ # 加载innodb
"--enable-static" \
"--enable-thread-safe-client" \
"--with-client-ldflags=-all-static" \
"--with-mysqld-ldflags=-all-static" \
"--enable-assembler" \
"--without-ndb-debug"
make&&make install
3、mysql初始化配置
cd /usr/local/mysql
mkdir -p /usr/local/mysql/data
useradd mysql -d /dev/null -s /sbin/nologin
chown -R root:mysql .
chown -R mysql /usr/local/mysql/data
/usr/local/mysql/bin/mysql_install_db --user=mysql
cat share/mysql/my-innodb-heavy-4G.cnf | grep -v "#" | grep -v "^$" > /etc/my.cnf
sed -i 's/skip-locking/skip-external-locking/' /etc/my.cnf
sed -i 's/no-auto-rehash/auto-rehash/' /etc/my.cnf
sed -i '/server-id/askip-name-resolve\nlog-error=/var/log/mysqld.log' /etc/my.cnf
echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
/etc/rc.d/init.d/mysqld start
tail /var/log/mysql.log
100422 15:12:03 mysqld_safe mysqld from pid file /usr/local/mysql/data/TEST.Mysql.pid ended
100422 15:12:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
100422 15:12:05 InnoDB: highest supported file format is Barracuda.
100422 15:12:05 InnoDB Plugin 1.0.6 started; log sequence number 44244
100422 15:12:05 [Note] Event Scheduler: Loaded 0 events
100422 15:12:05 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.1.45-XinYing-log' socket: '/tmp/mysql.sock' port: 3306 Test
100422 15:12:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
100422 15:12:05 InnoDB: highest supported file format is Barracuda.
100422 15:12:05 InnoDB Plugin 1.0.6 started; log sequence number 44244
100422 15:12:05 [Note] Event Scheduler: Loaded 0 events
100422 15:12:05 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.1.45-XinYing-log' socket: '/tmp/mysql.sock' port: 3306 Test
mysqladmin -u root -p password 密码
4.删除多余的用户
mysql -u root -p
mysql>drop user root@127.0.0.1;
mysql>drop user root@localhost.localdomain;
mysql>drop user ''@localhost.localdomain;
mysql>drop user ''@localhost;
参考文档:http://www.innodb.com/doc/innodb_plugin-1.0/innodb-plugin-installation.html#innodb-plugin-installation-source-unix
转载于:https://blog.51cto.com/slevin/302971