1.mysql
初始密码
sudo apt-get update
sudo apt-get install mysql-server 服务端
sudo apt-get install mysql-client 客户端
mysql -u root
无密码进入mysql命令行界面
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'
;修改root用户的密码
update user set host = '%' where user = 'root' and host='localhost';
GRANT ALL ON *.* TO 'root'@'%';
参考!
初始化密码完成!
远程连接
use mysql
进入到mysql库中
select host, user, authentication_string, plugin from user;
查看user表
update user set host = '%' where user = 'root';
将root的登录端口切换为所有
grant all on *.* to 'root'@'%';
设置远程连接
flush privileges;
执行刷新权限
在mysql配置文件中将#bind-address = 127.0.0.1
注释
完成!
2.redis
apt-get install redis
安装完毕后进入配置文件
注释bind 127.0.0.1
protected-mode yes
改为 protected-mode no
设置密码
redis-server /etc/reids/redis.conf
重启服务