zoukankan      html  css  js  c++  java
  • mysql 空密码 安装

    Mysql 源码安装操作:
     
    1. 创建用户
    # groupadd mysql
    # useradd -g -r mysql mysql
     
    2. 解压缩tar包
    # tar xf mysql-5.6.25.tar.gz
    # cd mysql-5.6.25
     
    3. 编译安装
    # cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
    > -DDEFAULT_CHARSET=gbk
    > -DDEFAULT_COLLATION=gbk_chinese_ci
    > -DENABLED_LOCAL_INFILE=ON
    > -DWITH_INNOBASE_STORAGE_ENGINE=1
    > -DWITH_FEDERATED_STORAGE_ENGINE=1
    > -DWITH_BLACKHOLE_STORAGE_ENGINE=1
    > -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock
    > -DWITH_DEBUG=0
    > -DMYSQL_TCP_PORT=3306
    # make
    # make install
     
    4. 配置以及初始化MySQL
    # cd /usr/local/mysql
    4.1 设置MySQL安装目录的权限
    # chown -R mysql:mysql /usr/local/mysql
    4.2 初始化MySQL
    # scripts/mysql_install_db --user=mysql
    # cp support-files/mysql.server /etc/init.d/mysqld
    4.3 重新设置MySQL安装目录的权限(除data目录外,其余所有目录及文件均修改用户为root,组不变)
    # chown -R root .
    # chown -R mysql data
    4.4 启动mysql_safe
    # bin/mysqld_safe --user=mysql &
    4.5 设置MySQL的root帐号密码
    - 自动设置:# ./bin/mysql_secure_installation
    - 手动置:# ./bin/mysqladmin -u root password '<PASSWORDHERE>'
     
    ------------------
    操作详情参看: https://github.com/Marslo/MyBlog/blob/master/Programming/MySQL/MySQLInstallationBySourceCode.md
    MySQL6源码安装官方手册: http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html
     
    ————————————————————
    /usr/local/mysql/bin/mysql -uroot -p   启动控制台
    netstat -nlt查看端口
    /etc/init.d/mysqld start  启动mysql
     
     
     
     
     
    ————————————————————
    CREATE USER 'jame'@'%';
     
    GRANT GRANT OPTION ON *.* TO 'jame'@'%';
     
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'jame'@'%';
     
     
    ——————————————
    CREATE USER 'james'@'%' IDENTIFIED BY 'james';
     
    GRANT GRANT OPTION ON *.* TO 'james'@'%';
     
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'james'@'%';
  • 相关阅读:
    TODO C++ lambda表达式
    C++ Map实践
    【转】C++ typedef typename 作用
    C++ Vector实践
    再学引用
    设置table中的td一连串内容自动换行
    JavaScript中基本数据类型和引用数据类型的区别
    “浏览器模式”和“文档模式”之间的区别
    浏览器模式与文档模式区别
    HTML5中的data-*属性和jQuery中的.data()方法使用
  • 原文地址:https://www.cnblogs.com/csjoz/p/7243971.html
Copyright © 2011-2022 走看看