zoukankan      html  css  js  c++  java
  • Centos7:mysql5.6安装,配置及使用(RPM方式)

    1.首先安装好jdk环境,本机所用环境为jdk1.8

    2.卸载MariaDB(Centos7自带)与Mysql

    2.1卸载:MariaDB

    #rpm -qa | grep -i mariadb //查询安装的MariaDB
    #rpm -e --nodeps 查到软件名 //卸载相关MariaDB的所有软件
    #find / -name mariadb
    #whereis mariadb //查找是否有相关配置目录及文件,如有,则 rm -rf 删除

    2.2卸载mysql

    #whereis mysql
    #find / -name mysql //查找是否有相关配置目录及文件,如有,则 rm -rf 删除

    #rm -rf /etc/my.cnf //删除mysql配置文件

    chkconfig --list|grep -i mysql //查看服务
    chkconfig --del mysql //删除服务

    3. 安装依赖

    #yum -y install autoconf

    4.解压MySQL-5.6.41-1.el7.x86_64.rpm-bundle

    #tar -xvf MySQL-5.6.41-1.el7.x86_64.rpm-bundle.tar //解压mysql数据库;

    5.开始安装

    yum install net-tools //先安装net-tools,mysqlServer安装需要

    #rpm -ivh MySQL-server-5.6.41-1.el7.x86_64.rpm //安装mysql server

    #rpm -ivh MySQL-client-5.6.41-1.el7.x86_64.rpm //安装mysql client

    6.启动mysql服务

    #service mysql start

    #service mysql status //查看mysql状态

    7.登录mysql

    #mysql -uroot -p //默认密码在/root/.mysql_secret中

    8.修改密码

    > SET PASSWORD = PASSWORD('123456'); //修改root密码

    9.配置mysql

    #chkconfig --add mysql //加入到系统服务

    #chkconfig mysql on //设置mysql自动启动

    #chkconfig //查询自启列表

    10.关闭系统防火墙

    #systemctl stop firewalld//关闭防火墙

    systemctl status firewalld //查看状态

    systemctl disable firewalld//开机禁用

    11.赋予root远程访问权限

    grant all privileges on *.* to 'root' @'%' identified by '123456';

    flush privileges;//更新权限

    配置大小写不敏感

    /etc/my.cnf

    [mysqld]后添加lower_case_table_names=1

    注:默认mysql目录为/local/share/mysql,如果my.cnf不存在,可以复制my-default.cnf

  • 相关阅读:
    Java中printf
    error C3688: invalid literal suffix '__FSTREXP'; literal operator or literal operator template 'operator ""__FSTREXP' not found
    C# IIS 访问网络映射磁盘 读取文件列表
    datatables 参数详解
    Telnet协议详解
    WCF中的ServiceHost初始化两种方式
    C# FTP 上传、下载、获取文件列表
    Oracle存储过程编译卡死的解决方法
    oracle 查询表结构
    Oracle大数据常见优化查询
  • 原文地址:https://www.cnblogs.com/-saligia-/p/9748148.html
Copyright © 2011-2022 走看看