mysql-5.7.18安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql-5.7.18安装相关的知识,希望对你有一定的参考价值。
[[email protected] ~]# yum -y install gcc gcc-c++ autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake libaio libaio-devel autoconf bzr bison libtool
[[email protected] ~]#groupadd mysql
[[email protected] ~]#useradd -g mysql mysql
[[email protected] ~]#tar xf mysql-5.7.18.tar.gz
[[email protected] ~]cd mysql-5.7.18
[[email protected] ~]cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost
[[email protected] ~]make && make install
[[email protected] ~]./bin/mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql --socket=/tmp/mysql.sock
[[email protected] ~]cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[[email protected] ~]vim /etc/my.cnf
[mysqld]
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
port=3306
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[[email protected] ~]# /etc/init.d/mysqld start
[[email protected] ~]#echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
[[email protected] ~]#source /etc/profile
连接mysql就可以了。
以上是关于mysql-5.7.18安装的主要内容,如果未能解决你的问题,请参考以下文章