mysql install on centos6.5
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql install on centos6.5相关的知识,希望对你有一定的参考价值。
系统:centos 6.5
软件:mysql-5.6.36.tar.gz,libunwind-1.2.tar.gz,google-perftools-1.9.tar.gz,cmake-3.4.1.tar.gz,epel-release-6-8.noarch.rpm
[[email protected] ~]# echo "192.168.40.35 king01" >>/etc/hosts
[[email protected] ~]# rpm -ivh epel-release-6-8.noarch.rpm
[[email protected] ~]# yum install -y libaio* ncurses-devel
[[email protected] ~]# useradd mysql
[[email protected] ~]# cat >> /etc/security/limits.conf <<EOF
mysql soft nproc 2047
mysql hard nproc 16384
mysql soft nofile 1024
mysql hard nofile 65536
EOF
[[email protected] ~]# tar zxvf libunwind-1.2.tar.gz
[[email protected] ~]# cd libunwind-1.2
[[email protected] libunwind-1.2]# ./configure
[[email protected] libunwind-1.2]# make && make install
[[email protected] ~]# tar zxvf google-perftools-1.9.tar.gz
[[email protected] ~]# cd google-perftools-1.9
[[email protected] google-perftools-1.9]# ./configure
[[email protected] google-perftools-1.9]# make && make install
[[email protected] ~]# tar zxvf cmake-3.4.1.tar.gz
[[email protected] ~]# cd cmake-3.4.1
[[email protected] cmake-3.4.1]# ./configure
[[email protected] cmake-3.4.1]# gmake && make install
[[email protected] ~]# tar zxvf mysql-5.6.36.tar.gz
[[email protected] ~]# cd mysql-5.6.36
[[email protected] mysql-5.6.36]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
[[email protected] mysql-5.6.36]# make && make install
[[email protected] ~]# /usr/local/mysql/bin/resolveip king01
[[email protected] ~]# cd mysql-5.6.36/support-files/
[[email protected] support-files]# cp mysql.server /etc/init.d/mysqld
[[email protected] support-files]# chmod a+x /etc/init.d/mysqld
[[email protected] ~]# cd /usr/local/mysql
[[email protected] mysql]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[[email protected] ~]# vim /etc/profile
PATH=$PATH:/usr/local/mysql/bin
[[email protected] ~]# source /etc/profile
[[email protected] ~]# vi /usr/local/mysql/bin/mysqld_safe
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so
[[email protected] ~]# service mysqld start
Starting MySQL.. [ OK ]
[[email protected] ~]# netstat -tupln |grep mysqld
tcp 0 0 :::3306 :::* LISTEN 10101/mysqld
[[email protected] ~]# lsof -n | grep tcmalloc
mysqld 10101 mysql mem REG 8,2 2212357 441654 /usr/local/lib/libtcmalloc.so.0.3.0
[[email protected] ~]# echo "/usr/local/mysql/lib" > /etc/ld.so.conf.d/mysql.conf
[[email protected] ~]# ldconfig
[[email protected] ~]# mysqladmin -u root password 'abcd.1234'
[[email protected] ~]# mysql -u root -pabcd.1234
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
以上是关于mysql install on centos6.5的主要内容,如果未能解决你的问题,请参考以下文章
Install PHP 7, Apache, MySQL 5.6 on CentOS / RHEL 7.1 & 6.7 + Wordpress
How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7