zoukankan      html  css  js  c++  java
  • mysql5.5编译安装

    首先规划好

    端口:3306
    管理员名称:cool
    安装基本目录:/usr/local/mysql
    数据库目录:/data
    二进制日志目录:/var/log/mysqld
    延迟日志目录:/var/log/mysqld(延迟日志目录  这个还不怎么明白)
    启动文件:/var/run/mysqld

    添加mysql用户

    #groupadd -r mysql

    # useradd -r -g mysql -s /sbin/nologin mysql

    #cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=complex -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_SSL=yes -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data  -DMYSQL_TCP_PORT=3306

    ENABLED_LOCAL_INFILE 是否开启客户端本地存储以减轻数据库的负载

    #make

    #make install

    #ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

    #ln -s /usr/local/mysql/bin/mysql /bin/mysql

    删除空密码、匿名的用户

    mysql> delete from mysql.user where password='';
    mysql> delete from mysql.user where user='';
    mysql> flush privileges;

    创建数据库管理帐户,允许远程用户访问。并将root更名为其他名称

    mysql> CREATE USER 'cool'@'%' IDENTIFIED BY '123456';
    mysql> GRANT ALL ON *.* TO 'cool'@'%' WITH GRANT OPTION;
    mysql> RENAME USER 'root'@'localhost' TO 'cool'@'localhost';
    mysql> flush privileges;

    安全

    除了管理员帐号外,不要把file, process, super,reload,shutdown,grant权限授予管理员以外的账号

    update mysql.user set file_priv = 'N' Where User=user_name and host =
    host_name
    update mysql.user set process_priv = 'N' Where User=user_name and host =
    host_name
    update mysql.user set super_priv = 'N'Where User=user_name and host =
    host_name
    update mysql.user set reload_priv = 'N' Where User=user_name and host =
    host_name
    update mysql.user set shutdown_priv = 'N' Where User=user_name and host =
    host_name
    update mysql.user set grant_priv = 'N' Where User=user_name and host =
    host_name

  • 相关阅读:
    node eventLoop
    apply call bind
    crm项目-业务实现
    crm项目-stark组件分析
    OA项目-需求分析
    OA项目-表结构
    OA项目-xadmin使用
    路飞学城项目-表结构
    路飞学城项目-支付相关-支付宝第三方支付
    路飞学城项目-支付相关-支付接口
  • 原文地址:https://www.cnblogs.com/cool4ever/p/5238824.html
Copyright © 2011-2022 走看看