服务器搭建

docker 下载

安装mysql

docker pull mysql:8.0

docker run -p 13306:3306 --name mysql -v /usr/local/docker/mysql/conf:/etc/mysql -v /usr/local/docker/mysql/logs:/var/log/mysql -v /usr/local/docker/mysql/data:/var/lib/mysql -v /home/mysql/mysql-files:/var/lib/mysql-files -e MYSQL_ROOT_PASSWORD=123456 -itd mysql:8.0
docker exec -it mysql /bin/bash
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

添加远程登录用户

CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

安装nginx

wget http://nginx.org/download/nginx-1.16.1.tar.gz
yum install -y gcc c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
tar -zxvf nginx-1.16.tar.gz
cd nginx-1.16.1
./configure
make &&  make install
cd /usr/local/nginx/sbin
./nginx

你可能感兴趣的:(服务器搭建)