• centos7 & mysql


    首先centos7很坑爹。

    其次,在centos7上安装mysql更坑爹。

    特此记录一次坑爹历程后的唯一出路。

    安装mysql

    wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
    sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
    sudo yum install mysql-server

    配置

    默认的/etc/my.cnf基本啥都没,参考版本:http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

    最小版本:

    # For advice on how to change settings please see
    # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
    
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    
    # Recommended in standard MySQL setup
    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
    port=3306
    collation-server = utf8_unicode_ci
    init-connect='SET NAMES utf8'
    character-set-server = utf8
    default-storage-engine=InnoDB
    #default-table-type=InnoDB
    
    
    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    创建mysql用户略

    安装默认数据库!

    mysql_install_db --datadir=/var/lib/mysql

    启动服务

    mysqld_safe

    用service mysqld restart只会掉进很深很深的坑,此处省略一万字。

    转载请注明本文来源:http://www.cnblogs.com/Tommy-Yu/p/5501861.html

    谢谢!

  • 相关阅读:
    Python学习进程(1)Python简介
    OpenGL学习进程(10)第七课:四边形绘制与动画基础
    OpenGL学习进程(9)在3D空间的绘制实例
    GO语言结构体
    GO指针
    GO值类型与引用类型
    GO函数
    GO map
    GO切片
    GO数组
  • 原文地址:https://www.cnblogs.com/Tommy-Yu/p/5501861.html
Copyright © 2020-2023  润新知