yum

常用

    下载weget获取的软件
        rpm -ivh xxxx.rpm 
        yum install xxxxx  
    查看已安装的程序的安装包路径
        rpm -ql 程序包
    查看已安装的程序
        rpm -qa | grep -i 程序包
    删除已安装的程序包
        yum remove 程序包
    指定目录安装
        yum -c /etc/yum.conf --installroot=/opt/all_venv/ --releasever=/  install xxxxx
    yum可安装文件路径
        /etc/yum.repos.d/

mysql

安装mysql
    下载mysql的yum repository
        wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
    安装下载好的yum repository
        rpm -ivh mysql57-community-release-el7-10.noarch.rpm
    查看/etc/yum.repos.d/下多了两个mysql的repo
        mysql-community.repo     mysql-community-source.repo
    开始安装mysql
        yum -y install mysql-community-server
    设置这个防止找不到    mysql-community-server
        sudo yum module disable mysql
    执行安装
        yum -y install mysql-community-server
配置mysql
    启动Mysql
        systemctl start  mysqld.service
    查看Mysql状态
        systemctl status  mysqld.service
    获取root用户的密码
        grep "password" /var/log/mysqld.log
    登录mysql 
        mysql -uroot -p
    MySql重新设置密码,MySQL必须修改密码后才能操作数据库
        ALTER USER 'root'@'localhost' IDENTIFIED BY 'weitao@1993';
    如果设置不成功,修改密码规范
        set global validate_password.policy=0;
        set global validate_password.length=1;
    设置允许远程连接
        update user set host = '%' where user = 'root' and host='localhost';
        低版本
            grant all privileges on *.* to 'root'@'%' identified by 'weitao@1993' ;
        高版本
            grant all privileges on *.* to 'root'@'%' with grant option ;
        flush privileges;
    更新用户加密方式
        ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'weitao@1993';
    关闭防火墙
        systemctl stop firewalld
    

nginx

nginx
    安装依赖
        yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

1

你可能感兴趣的:(linux,&,cmd)