wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar zxvf nginx-1.12.2.tar.gz
cd nginx-1.12.2
./configure --prefix=/usr/local/nginx --with-pcre(伪静态支持) //安装在/usr/local/nginx
提示错误,HTTP重写模块需要PCRE库,需要安装pcre-devel包;
checking for PCRE library ... not found
yum install pcre-devel
缺什么库继续安装
make && make install
echo $? //用来验证是否安装成功 输出0说明成功
/usr/local/nginx/sbin/nginx ---->nginx 以下用软连接
启动:nginx
停止:nginx -s stop
重启:nginx -s reopen
动态加载配置:nginx -s reload
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar
添加系统mysql组和mysql用户:
执行命令:groupadd mysql和useradd -r -g mysql mysql
tar xvzf ./src/mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.27-linux-glibc2.5-x86_64 /usr/local/mysql
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
chown -R root:root .
chown -R mysql:mysql data
#添加启动服务
cp support-files/mysql.server /etc/init.d/mysql
service mysql start
#设置root用户密码
./bin/mysqladmin -u root password ‘123456‘
遇到的问题
[root@localhost mysql]# ./bin/mysql
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
解决方法
[root@localhost mysql]# ./bin/mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[root@localhost mysql]# ./bin/mysql -u root mysql
改密码:
mysql> UPDATE user SET Password=PASSWORD(‘123456‘) where USER=‘root‘;
mysql> FLUSH PRIVILEGES;
外网用navicat连接出现13800错误:一般是root账号没开放外网权限或者3306端口没有开放
telnet 公网ip 3306 报错//说明一般是root账号没开放外网权限
处理方法:
mysql -u root -pvmwaremysql>use mysql;
mysql>update user set host = ‘%‘ where user = ‘root‘;//这里报错没关系 只要修改到了一条数据有host=%就行
mysql>select host, user from user;
service mysql restart //重启