---
title: "mysql安装记录"
author: "linshow26"
date: "2014-06-07T18:52:25Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2014-06-07T18:52:25Z"
id: 2077083
url: "https://linshow26.iteye.com/blog/2077083"
---

yum –y install gcc* 
yum –y install gcc*
yum install gcc*
yum -y install ncurses-devel
wget   http://down1.chinaunix.net/distfiles/mysql-5.1.57.tar.gz
groupadd mysql
useradd -g mysql mysql
mkdir -p /usr/local/mysql1/data 
mkdir -p /usr/local/mysql1/tmp 
cd mysql-5.1.57 
./configure --prefix=/usr/local/mysql1 --localstatedir=/usr/local/mysql1/data --with-mysqld-user=mysql --with-charset=utf8 --with-unix-socket-path=/usr/local/mysql1/tmp/mysql.sock
make install
cp support-files/my-medium.cnf /usr/local/mysql1/my.cnf 
vi   /usr/local/mysql1/my.cnf 
chown mysql:mysql /usr/local/mysql1/my.cnf 
cd /usr/local/mysql1 
bin/mysql_install_db --basedir=/usr/local/mysql1 --datadir=/usr/local/mysql1/data --user=mysql 
bin/mysqld_safe --defaults-file=/usr/local/mysql1/my.cnf &
bin/mysqladmin -u root password 'xxxxx' 
ln -s /usr/local/mysql1/tmp/mysql.sock /tmp/mysql.sock 
chmod 755 /tmp/mysql.sock 
bin/mysql -u root -p  
bin/mysqld_safe --defaults-file=/usr/local/mysql1/my.cnf &