zoukankan      html  css  js  c++  java
  • mysql-8.0.16-linux-glibc2.12-x86_64

    MySQL8数据库安装部署

    1. 准备
      卸载之前安装过的版本
      确保之前安装过的版本完全卸载,包括老版本使用的数据文件。检查“/etc/my.cnf”,“/etc/mysql”,删除。
      依赖库 - libaio
      影响到数据目录初始化、服务启动。
    2. 安装
      启动MySQL的最简单方法:
      groupadd mysql
      useradd -r -g mysql -s /bin/false mysql
      # jeecg项目需要忽略掉数据库大小写
      bin/mysqld --initialize --user=mysql --lower-case-table-names=1
      bin/mysqld_safe --user=mysql &
      # Next command is optional
      cp support-files/mysql.server /etc/init.d/mysql.server
      # reset password
      mysql -uroot -p
      alter user root@localhost identified by '';
      View Code

      为启动脚本添加配置选项/etc/my.cnf:

      [mysqld]
      datadir=/usr/local/mysql/var
      socket=/var/tmp/mysql.sock
      port=3306
      user=mysql
      
      [mysql.server]
      basedir=/usr/local/mysql
      View Code
    3. 创建对象

      创建数据库、创建用户并授权

      create database if not exists db_name character set = utf8;
      create user user_name@'host_name' identified by 'user_pass';
      grant all privileges on db_name.* to 'user_name'@host_name;
      show grants for 'user_name'@host_name;
      View Code

      解决mysql2058

      alter user 'user_name'@'host_name' identified with mysql_native_password by 'user_pass';
      View Code
    4. 多实例运行
      选项:
      # Must have different values for each server instance.
      port=port_num
      socket={file_name|pipe_name}
      bind_address=0.0.0.0
      datadir=dir_name
      pid-file=file_name
      
      # log file options
      general_log_file=file_name
      log-bin[=file_name]
      slow_query_log_file=file_name
      log-error[=file_name]
      
      # To achieve better performance.
      tmpdir=dir_name
      View Code

    MySQL5

    一切代码都是为了生活,一切生活都是调剂
  • 相关阅读:
    Memory Limit Exceeded
    浙江省程序设计竞赛2019
    hdu3974 Assign the task
    TCP面向字节流和UDP面向报文的区别
    django-admin和django-admin.py的区别
    利用 pip 安装 Python 程序包到个人用户文件夹下
    PyCharm中目录directory与包package的区别及相关import详解
    分布式表示(Distributed Representation)
    Nginx
    32.最长有效括号
  • 原文地址:https://www.cnblogs.com/argor/p/10824841.html
Copyright © 2011-2022 走看看