• mysql 安装


    
    
    centos7 安装mysql

    1.源安装
    wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
    sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
    yum update
    sudo yum install mysql-server
    sudo systemctl start mysqld
    
    2.文件安装
    #解压
    tar -zxvf mysql-5.1.61.tar.gz  
    #增加用户和组
    groupadd mysql
    useradd -s /sbin/nologin -M -g mysql mysql
    
    #安装相关软件
    yum -y install gcc
    yum -y install gcc-c++
    yum -y install ncurses-devel
    
    #编译
    ./configure --prefix=/usr/local/mysql
    make
    make install
    
    #拷贝配置及服务
    cd /usr/local/mysql/share/mysql/
    cp my-medium.cnf /etc/my.cnf
    cp mysql.server /etc/init.d/mysqld
    
    #初始化数据库
    cd /usr/local/mysql/bin/
    ./mysql_install_db 
    
    vi /etc/my.cnf
    #[mysqld]下增加配置
    log-error=/var/log/mysqld.log
    default-character-set=utf8
    general_log = 1 
    general_log_file=/var/log/mysqld_general_log.log
    
    vi /etc/profile
    #增加环境变量
    export PATH=$PATH:/usr/local/mysql/bin
    #环境变量生效
    source /etc/profile
    
    #添加文件夹权限
    chown mysql:mysql /usr/local/mysql/ -R
    
    #启动服务
    service mysqld start
    
    #初始化root密码
    mysql -uroot
    DELETE FROM mysql.user WHERE user='';
    UPDATE mysql.user set password=PASSWORD('cO6Yt6Rs') where User='root';
    FLUSH PRIVILEGES;
    
    #授权用户
    mysql -uroot -pcO6Yt6Rs
    GRANT ALL PRIVILEGES ON *.* TO 'admin'@'58.100.%.%' IDENTIFIED BY 'rqXHR8we'; 
    GRANT ALL PRIVILEGES ON *.* TO 'admin'@'125.210.%.%' IDENTIFIED BY 'rqXHR8we'; 
    FLUSH PRIVILEGES;
    

      

     

  • 相关阅读:
    二级菜单
    侧面导航
    QFileDialog文件保存
    GitHub for window
    Qt学习事件/信号
    开始RTThread之旅
    Qt事件过滤器
    LPC1768开发板液晶问题解决
    用QSplitter分裂器实现QTextEdit窗口大小的变化
    Qt之串口编程使用事件驱动来触发接收数据
  • 原文地址:https://www.cnblogs.com/xdsfoo/p/6253179.html
Copyright © 2020-2023  润新知