centos服务器环境部署运维套餐

MYSQL

1、 下载并安装MySQL官方的 Yum Repository
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
yum localinstall mysql80-community-release-el7-1.noarch.rpm
修改安装版本(非必须)
vi /etc/yum.repos.d/mysql-community.repo
enable=0 改为 enable=1
2、安装MYSQL
yum -y install mysql-community-server
3、启动MYSQL
systemctl start  mysqld.service
4、查看是否启动
systemctl status mysqld.service
5、查看默认MYSQL密码
grep "password" /var/log/mysqld.log
6、输入密码进入数据库
mysql -uroot -p
7、修改默认密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
8、开启远程访问
GRANT ALL PRIVILEGES ON *.*TO 'root'@'%' IDENTIFIED BY 'new password' WITH GRANT OPTION;
// new password 是外网访问密码
9、刷新
flush privileges;

Redis

1、安装
yum install redis
2、启动
service redis start
3、打开客户端
redis-cli
4、远程访问
vi /etc/redis.conf
# bind 127.0.0.1 ::1
bind 192.168.146.31
# 重启服务

你可能感兴趣的:(centos)