• 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

    一切代码都是为了生活,一切生活都是调剂
  • 相关阅读:
    作业20170928--2 单元测试
    作业20170928—1代码规范,结对要求
    第三周PSP
    20170922-3 功能测试作业
    第二周PSP
    采用c#实现功能1
    linux下搭建生成HLS所需的.ts和.m3u8文件
    android编译ffmpeg+x264
    ubuntu.sh: 113: ubuntu.sh: Syntax error: "(" unexpected
    解决:[WARNING] fpm_children_bury(), line 215: child 2736 (pool default) exited on signal 15 SIGTERM after 59.588363 seconds from start
  • 原文地址:https://www.cnblogs.com/argor/p/10824841.html
Copyright © 2020-2023  润新知