天天看点

linux centos7.2 安装mysq,nginx,phpwget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpmyum install mysql-community-server

linux centos7.2 安装mysq

由于yum源上没有mysql-server。所以必须去官网下载,这里 我们用wget命,**直接获取。    

完成之后重新启动

systemctl restart mysqld.service

终端下查看 mysql 版本

mysql -v

mysql ver 14.14 distrib 5.6.35, for linux (x86_64) using editline wrapper

我们给mysql 设置一个密码

mysqladmin -u root password "123456"

下面可能会警告

warning: using a password on the command line interface can be insecure.

就是说命令行使用密码可能会不安全

此时我们已经设置好mysql 的密码

mysql -u root -p123456 直接进入

此时我们想在windows 下使用工具连接,会报错误1130

我们在linux 修改/etc/my.cnf

加入

skip-grant-tables

即可连接

安装nginx

我们直接用yum源安装

yum -y install nginx

systemctl start nginx 启动nginx

systemctl restart nginx 重启nginx

systemctl stop nginx 停止nginx

安装php

yum -y install php-fpm

对于nginx我们安装的是php-fpm

继续阅读