Chinaunix首页 | 论坛 | 博客
  • 博客访问: 18095
  • 博文数量: 4
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 56
  • 用 户 组: 普通用户
  • 注册时间: 2013-10-24 12:12
文章分类

全部博文(4)

文章存档

2014年(4)

我的朋友

分类: Mysql/postgreSQL

2014-02-13 17:30:08

1)创建用户

useradd -r -s /sbin/nologin mysql

mkdir /data/mysql -p

2)下载并解压安装

wget

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 recommended to 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

阅读(986) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~