mysql5.1安装教程

1)创建用户

useradd -r -s /sbin/nologin mysql

mkdir /data/mysql -p

2)下载并解压安装

wget http://mysql.ntu.edu.tw/Downloads/MySQL-5.1/mysql-5.1.62.tar.gz

tar -zxvf mysql-5.1.62.tar.gz

cd mysql-5.1.62

./configure --prefix=/usr/local/mysql--datadir=/data/mysql --with-mysqld-user=mysql --enable-assembler--enable-thread-safe-client --with-big-tables --without-debug --with-pthread--with-extra-charsets=complex --with-readine --with-ssl --with-embedded-server--enable-local-infole --with-plugin=partition,innobase --with-plugin-PLUGIN--with-mysqld-ldflags=-all-static --with-client-ldfags=-all-static


3)安装前的准备

vim /etc/my.cnf

[mysqld]

datadir=/data/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommendedto prevent assorted security risks

symbolic-links=0


[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/lib/mysql/mysqld.pid


chown -R mysql:mysql /usr/local/mysql

chown -R mysql:mysql /data/mysql

chown -R mysql:mysql /var/lib/mysql

cat /etc/profile.d/mysql.sh

export PATH=$PATH:/usr/local/mysql


source /etc/profile.d/mysql.sh

4)安装

/usr/local/mysql/bin/mysql_install_db--basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql


cp /mysql-5.1.62/support-files/mysql.server/etc/init.d/mysqld

vim /etc/init.d/mysqld

basedir=/usr/local/mysql

datadir=/data/mysql


Chmod +x /etc/mysqld

5)启动

mysqladmin-u root –pmysql


本文出自 “云计算数据为王” 博客,请务必保留此出处http://markhome.blog.51cto.com/2045402/1358909

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。