1 Linux常用开发工具安装
1 安装Mysql
①基本安装
wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm; sudo rpm -ivh mysql57-community-release-el7-10.noarch.rpm ; yum -y install mysql-server; service mysqld restart;
②设置密码,基本安装完成后root账号是没有密码的,我们可以给root账号设置一个密码;
grep "password" /var/log/mysqld.log mysql -u root -p alter user ‘root‘@‘localhost‘ identified by ‘Root123!‘
③远程访问(默认只能通过localhost访问,将host设置为‘%’即可远程访问)
//1.设置root账号远程可访问 mysql -u root -p mysql>use mysql; mysql>update user set host = ‘%‘ where user = ‘root‘; mysql>select host, user from user; FLUSH PRIVILEGES; //2.添加新用户,设置新用户远程可访问 create user ‘wyy‘@‘%‘ identified by ‘Root123!‘; GRANT ALL PRIVILEGES ON *.* TO ‘wyy‘@‘%‘ WITH GRANT OPTION; FLUSH PRIVILEGES;
2 安装Redis
①基本安装
//获取资源 wget http://download.redis.io/releases/redis-5.0.3.tar.gz; //解压 tar xzf redis-5.0.3.tar.gz; //安装gcc和tcl(因为redis是c++写的,需要gcc编译) yum install gcc; yum install tcl; //编译 cd redis-5.0.3; make MALLOC=libc; //安装 cd src; make install;
②基本安装下,redis没有密码,同时远程不能访问,可以做一下配置
//因为localhost只能本机访问,设置ip后可以远程访问 bind: 192.168.70.99 //设置密码 requirepass:123321
③ 开启服务和客户端
//启动redis服务 redis-server /path/redis.conf //启动redis客户端 redis -h 192.168.70.99 -p 6339
原文地址:https://www.cnblogs.com/wyy1234/p/10474525.html
时间: 2024-10-19 08:01:47