zoukankan      html  css  js  c++  java
  • Linux MySQL5.6.36安装手册

    1 安装依赖包

    yum -y install perl perl-devel
    

    2 新建用户组合用户

    groupadd mysql
    useradd mysql -g mysql
    

    3 解压到data下面

    mkdir /data
    tar -zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz -C /data
    

    4 重命名

    cd /data
    mv mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz  mysql
    

    5 安装

    cd/data/mysql
    

    初始化安装

    /data/mysql/scripts/mysql_install_db --user=mysql --basedir=/data/mysql --datadir=/data/mysql/data
    

    出现以下报错解决方法:

    WARNING: The host 'MySQL' could not be looked up with /data/mysql/bin/resolveip.
    This probably means that your libc libraries are not 100 % compatible
    with this binary MySQL version. The MySQL daemon, mysqld, should work
    normally with the exception that host name resolving will not work.
    This means that you should use IP addresses instead of hostnames
    when specifying MySQL privileges !
    Installing MySQL system tables.../data/mysql/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
    

    添加IP对应的主机名

    vim /etc/hosts
    

    以及安装依赖关系libaia文件

    yum install libaio* -y
    

    6 更改所有者

    su root
    chown -R mysql:mysql /data/mysql
    cd /data/mysql/support-files/
    cp my-default.cnf /etc/my.cnf
    cp mysql.server /etc/init.d/mysqld
    

    7 设置环境变量

    echo 'PATH=/data/mysql/bin/:$PATH' >>/etc/profile
    source /etc/profile
    

    8 添加用户并授权

    修改root本地登陆密码

    set password=PASSWORD(‘vv@122’);
    grant all privileges on *.* to ‘vv’@'%' identified by 'vv@122';
    flush privileges;
    

    9设置开机自启动

    chkconfig --add mysqld
    
  • 相关阅读:
    Python中获取异常(Exception)信息
    Python 3.5 连接Mysql数据库(pymysql 方式)
    用命令查看Mysql中数据库、表的空间大小
    MySQLdb操作mysql的blob值
    mysql.connector操作mysql的blob值
    windows获取硬盘使用率等信息
    python操作系统环境变量
    git clone
    在Spring项目中使用Log4j记录日志
    org.apache.log4j.Logger详解
  • 原文地址:https://www.cnblogs.com/qiming0322/p/10132376.html
Copyright © 2011-2022 走看看