zoukankan      html  css  js  c++  java
  • mysql二进制安装

    1、mysql二进制下载安装

    下载地址  https://dev.mysql.com/downloads/mysql/5.7.html#downloads

    下载地址  https://dev.mysql.com/downloads/mysql/5.7.html#downloads

    2、上传到/usr/local/src

    3、解压

    mkdir -p /usr/local/mysql
    tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz  
    mv mysql-5.7.24-linux-glibc2.12-x86_64/* /usr/local/mysql

    4、新增mysql用户,授权用户

    useradd -s /sbin/nologin -M mysql
    chown -R mysql.mysql /usr/local/mysql

    5、安装依赖包

     yum install libaio -y

    6、安装msyql

    cd /usr/local/mysql
    ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
    提示:这里会生成随机密码,记下来(比如:#BOV*H%Zn8o=)

    7、配置my.cnf 

    vim /etc/my.cnf
    [mysqld] character
    -set-server=utf8 datadir=/usr/local/mysql/data basedir=/usr/local/mysql socket=/tmp/mysql.sock

    8、设置开启启动

    cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
    chkconfig --add mysqld

    9、设置环境变量

    vim /etc/profile
    MYSQL_HOME=/usr/local/mysql export PATH=$PATH:$MYSQL_HOME/bin

    #生效
    source /etc/profile

    10、启动修改密码

    /etc/init.d/mysqld start
    mysql> set password = password('mysql');
  • 相关阅读:
    获取文件夹下的所有子文件,读取TXT文档
    360笔试
    刷题总结
    背包问题
    二叉树的创建、层次遍历、前序遍历、中序遍历、后序遍历
    今日头条面试
    面试题目
    Java高并发秒杀优化
    配置tomcat解压版
    环境变量设置:
  • 原文地址:https://www.cnblogs.com/wangyong-blog/p/10115522.html
Copyright © 2011-2022 走看看