linux6.5的安装。
安装mysql
解压和下在cmake命令:
[root@server1 ~]# tar zxf mysql-boost-5.7.27.tar.gz
[root@server1 ~]# yum install cmake-2.8.12.2-4.el6.x86_64.rpm -y
现在依赖行软件:
[root@server1 ~]# yum install -y gcc ncurses-devel libtirpc-devel gcc-c++ bison
编译我们的软件:要在解压的mysql软件中
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql
-DMYSQL_DATADIR=/usr/local/lnmp/mysql/data \ #数据库存放目录
-DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock \ #Unix socket 文件路径
-DWITH_MYISAM_STORAGE_ENGINE=1 #安装 myisam 存储引擎
-DWITH_INNOBASE_STORAGE_ENGINE=1 #安装 innodb 存储引擎
-DDEFAULT_CHARSET=utf8 #使用 utf8 字符
-DDEFAULT_COLLATION=utf8_general_ci #校验字符
-DEXTRA_CHARSETS=all #安装所有扩展字符集
-DWITH_BOOST=boost/boost_1_59_0/
下来是安装
我们安装时给虚拟机加硬件。cpu:2。内存:2048。磁盘大小20G
#######################################################picture cpu1 内存1
当加装完毕后我们下来,下在编译的文件;
[root@server1 mysql-5.7.27]# make && make install
##等待时间较长
cd mysql-5.7.27/support-files/
##/etc/init.d/mysqld status
##rpm -qa | grep mysql
##yum remove 里面的软件
cp mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld status ##不应该运行
cd /usr/local/lnmp/mysql
cd support-files/
cd …
mysql:ls
cd mysql-5.7.27
cp /root/mysal-5.7.27/packaging/rpm-common/my.cnf /etc/my.cnf
vim /etc/my.cnf(1548)
cd /usr/local/lnmp/mysql
mkdir data
cd
useradd mysql
chowm mysql.mysql /usr/local/lnmp/mysql -R
lnmp: vim ~/.bash_profile
lnmp: source ~/.bash_profile
touch /var/log/mysqld.log
chowm mysql.mysql /var/log/mysqld.log
mysqld --user=mysql --initialize
grep password /var/log/mysqld.log
vim /etc/init.d/mysqld(1553)
/etc/init.d/mysald start
netstat -tnlp
[root@server1 ~]# mysql_secure_installation ##更改密码
#下载php
[root@server1 ~]# tar jxf php-5.6.35.tar.bz2
下载依赖性:
yum install -y libxml2-devel openssl-devel libcurl-devel freetype-config freetype-config-devel freetype-devel
yum install -y libmcrypt-devel libm* net-snmp-devel
yum whatprovides */jpeglib.h */png.h */gmp.h
进行编译:
./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-gmp --with-gettext --with-pear --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt --with-mhash
下载:
make && make install