• centos6.8服务器配置之MYSQL配置


    1、rpm安装方式顺序:
    下载:

    wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-server-5.7.19-1.el6.x86_64.rpm

    安装顺序:

    Installing : mysql-community-common-5.7.19-1.el6.x86_64
    Installing : mysql-community-libs-5.7.19-1.el6.x86_64
    Installing : mysql-community-libs-compat-5.7.19-1.el6.x86_64 
    Installing : mysql-community-client-5.7.19-1.el6.x86_64

    2、yum安装方式

    下载:

    wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm

    安装:

    rpm -ivh mysql57-community-release-el6-11.noarch.rpm
    yum -y install mysql-community-server

    3、卸载mysql5.7.19

    rpm -qa|grep -i mysql
    yum remove mysql-community-libs-5.7.19-1.el6.x86_64 mysql-community-client-5.7.19-1.el6.x86_64 mysql57-community-release-el6-11.noarch mysql-community-common-5.7.19-1.el6.x86_64 mysql-community-libs-compat-5.7.19-1.el6.x86_64 mysql-community-server-5.7.19-1.el6.x86_64
    whereis mysql //查看安装目录,分别删除

    4、初始化mysql

    #查看是否开机启动
    chkconfig --list | grep mysqld
    #设为开机启动
    chkconfig mysqld on
    #启动mysql进行初始化
    service mysqld start
    #查看密码
    grep "password" /var/log/mysqld.log
    #进入mysql
    mysql -uroot -p密码
    #修改密码
    set password for 'root'@'localhost' = password('新密码');

    5、修改mysql字符集为UTF-8:

    vim /etc/my.cnf; 
    在[mysqld]部分添加:character-set-server=utf8;
    在文件末尾新增[client]段,并在[client]段添加:default-character-set=utf8

    6、重启mysqld服务:

    service mysqld restart
  • 相关阅读:
    A1047 Student List for Course [unordered_map]
    .net 事务处理的三种方法
    SQline安装
    LeetCode 21 _ 合并两个有序链表
    LeetCode 191 _ 位1的个数
    LeetCode 268 _ 缺失数字
    LeetCode 190 _ 位运算
    LeetCode 136 _ 位运算
    LeetCode 461 _ 位运算
    LeetCode 125 _ 字符串
  • 原文地址:https://www.cnblogs.com/shangxia/p/7544873.html
Copyright © 2020-2023  润新知