码迷,mamicode.com
首页 > 数据库 > 详细

mysql-5.7.18安装

时间:2017-07-02 23:25:48      阅读:330      评论:0      收藏:0      [点我收藏+]

标签:groupadd   bin   mcrypt   isa   com   default   zlib   path   inf   

[root@localhost ~]# 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

[root@localhost ~]#groupadd mysql

[root@localhost ~]#useradd -g mysql mysql

[root@localhost ~]#tar xf mysql-5.7.18.tar.gz

[root@localhost ~]cd mysql-5.7.18

[root@localhost ~]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

[root@localhost ~]make && make install

[root@localhost ~]./bin/mysqld --initialize   --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql --socket=/tmp/mysql.sock

[root@localhost ~]cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

[root@localhost ~]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

[root@localhost ~]# /etc/init.d/mysqld start

[root@localhost ~]#echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile

[root@localhost ~]#source /etc/profile

连接mysql就可以了。

 

mysql-5.7.18安装

标签:groupadd   bin   mcrypt   isa   com   default   zlib   path   inf   

原文地址:http://www.cnblogs.com/Neverstopfootsteps/p/7107256.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!