---
title: "mysql 5.1.31安装脚本"
author: "wang_let"
date: "2009-03-19T09:33:00Z"
tags: []
slug: "mysql-5-1-31"
draft: false
lastmod: "2009-03-19T09:33:00Z"
id: 351303
url: "https://wang-let.iteye.com/blog/351303"
---

#!/bin/bash 
#wirte by badb0y 
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.31.tar.gz/from/http://mysql.easynet.be/
tar -zxvf mysql-5.1.31.tar.gz
cd mysql-5.1.31
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all --enable-assembler --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make;make install 
groupadd mysql
useradd -g mysql mysql
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf 
sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf 
/usr/local/mysql/bin/mysql_install_db --user=mysql
chmod +w /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/.
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
service mysql start 

文章出处：DIY部落(http://www.diybl.com/course/6_system/linux/Linuxjs/20090307/159040.html)