Home Database Mysql Tutorial CentOS 6.0 编译安装 MySQL 5.5.17_MySQL

CentOS 6.0 编译安装 MySQL 5.5.17_MySQL

Jun 01, 2016 pm 01:51 PM
Install article

CentOS

bitsCN.com

参考文章 http://www.discuz.net/thread-2250084-1-1.html

 

1.安装相关库文件  

yum install bison gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel libtool-ltdl-devel*

 

2.安装cmake  

wget http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz
tar zxvf cmake-2.8.6.tar.gz
cd cmake-2.8.6/
./configure
gmake

gmake install  

 

3.设置用户

/usr/sbin/groupadd mysql            (如果有提示已存在,并不是错误)

/usr/sbin/useradd -g mysql mysql     (如果有提示已存在,并不是错误)
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql

 

4.MYSQL 5.5.17

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz/from/http://mysql.ntu.edu.tw/

 

tar zxvf mysql-5.5.17.tar.gz
cd mysql-5.5.17
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc/
make
make install

 

5.设置

cd /usr/local/mysql

cp ./support-files/my-huge.cnf /etc/my.cnf 

 


编辑/etc/my.cnf

vi /etc/my.cnf

在 [mysqld] 段增加
datadir = /data/mysql
wait-timeout = 30
max_connections = 512
max_connect_errors = 10000000
default-storage-engine = MyISAM
在 [mysqld] 段修改

max_allowed_packet = 16M 

 

./scripts/mysql_install_db --user=mysql
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld

chkconfig --level 3 mysqld on 

 

编译/etc/rc.d/init.d/mysqld

vi /etc/rc.d/init.d/mysqld

把basedir=编辑成basedir=/usr/local/mysql

把datadir=编辑成datadir=/data/mysql 

 

service mysqld start

bin/mysqladmin -u root password 'password_for_root'
其中引号内的password_for_root是要设置的root密码
service mysqld restart


进入Mysql 

bin/mysql -uroot -p

 

 

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solution to the problem that Win11 system cannot install Chinese language pack Solution to the problem that Win11 system cannot install Chinese language pack Mar 09, 2024 am 09:48 AM

Solution to the problem that Win11 system cannot install Chinese language pack

Unable to install guest additions in VirtualBox Unable to install guest additions in VirtualBox Mar 10, 2024 am 09:34 AM

Unable to install guest additions in VirtualBox

What should I do if Baidu Netdisk is downloaded successfully but cannot be installed? What should I do if Baidu Netdisk is downloaded successfully but cannot be installed? Mar 13, 2024 pm 10:22 PM

What should I do if Baidu Netdisk is downloaded successfully but cannot be installed?

How can I make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! How can I make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! Mar 15, 2024 pm 04:13 PM

How can I make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today!

How to install Android apps on Linux? How to install Android apps on Linux? Mar 19, 2024 am 11:15 AM

How to install Android apps on Linux?

How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 Mar 22, 2024 pm 04:40 PM

How to Install and Run the Ubuntu Notes App on Ubuntu 24.04

How to install Podman on Ubuntu 24.04 How to install Podman on Ubuntu 24.04 Mar 22, 2024 am 11:26 AM

How to install Podman on Ubuntu 24.04

How to install solidworks2018-solidworks2018 installation tutorial How to install solidworks2018-solidworks2018 installation tutorial Mar 04, 2024 pm 09:00 PM

How to install solidworks2018-solidworks2018 installation tutorial

See all articles