• MySQL二进制安装


    前提

    version  mysql-5.5

    platform  centos6.x

    添加用户

    useradd -M -s /sbin/nologin mysql

    安装需要的包

    yum -y install compat-libstdc++-33.x86_64 libaio.x86_64

    安装

    tar xzvf mysql-5.5.43-linux2.6-x86_64.tar.gz

    mkdir -p /storage/server

    mv -f mysql-5.5.43-linux2.6-x86_64 /storage/server/

    ln -sf /storage/server/mysql-5.5.43-linux2.6-x86_64 /storage/server/mysql

    chown -R mysql:mysql /storage/server/mysql/

    # 新建mysql数据目录

    mkdir -p /storage/data/mysql

    chown -R mysql:mysql /storage/data/mysql

    初始化

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

    修改配置文件

    vim /etc/my.cnf

    [mysqld]
    port            = 3306
    socket          = /tmp/mysql.sock
    basedir = /storage/server/mysql
    datadir = /storage/data/mysql

    启动(推荐用mysqld_safe)

    /storage/server/mysql/bin/mysqld_safe &

    # mysqld_safe默认mysqld的路径为 /usr/local/mysql/bin/mysqld,没有下面步骤用mysqld_safe启动会报错

    mkdir -p /usr/local/mysql/bin

    ln -sf /storage/server/mysql/bin/mysqld /usr/local/mysql/bin/mysqld

    安全设置(根据脚本提示对数据库做一些安全设置)

    /storage/server/mysql/bin/mysql_secure_installation

  • 相关阅读:
    ArcObject获取ArcMap默认地理数据库的路径
    标准IO
    进程关系
    进程环境
    C语言基础知识位运算
    Bash 快捷键
    信号
    UNIX系统文件
    进程
    unix 文件属性
  • 原文地址:https://www.cnblogs.com/metasequoia/p/5793233.html
Copyright © 2020-2023  润新知