• linux mysql安装(离线) 涂涂


    下载文件,地址:https://dev.mysql.com/downloads/mysql/ 下载的文件例如:mysql-8.0.29-linux-glibc2.12-x86_64.tar.xz

    安装有问题请访问:这里,(主要是权限和路径问题,整了好几天。。。)


    1、设置变量
      installpath="/usr/local/mysql" && packagename="mysql-8.0.29-linux-glibc2.12-x86_64" && datapath="/data/mysql/data"
    2、初始化环境
      rm -rf $installpath/mysql*
      mkdir -p $installpath/$packagename
      mkdir -p $datapath
    3、解压
      tar -xzvf $packagename.tar.gz -C $installpath/
    4、用户和组
      groupadd mysql
      useradd -r -g mysql -s /bin/false mysql
    5、赋权
      chown -R mysql:mysql $installpath
    6、安装
      ./scripts/mysql_install_db --user=mysql --basedir=$installpath/$packagename/ --datadir=$datapath
    7、赋权
      chown -R root:root $installpath/$packagename
      chown -R mysql:mysql $datapath
    8、配置my.cnf(如果有则复制过来改改)

    9、启动
      $installpath/$packagename/support-files/mysql.server start

    10、修改密码,默认为123456
      $installpath/$packagename/bin/mysqladmin -u root -h localhost.localdomain password '123456'

    11、增加远程登录
      $installpath/$packagename/bin/mysql -u root -h 127.0.0.1 -p '123456'

    12、关闭防火墙
      systemctl stop firewalld.service
      systemctl disable firewalld.service
      firewalld-cmd --state
      service iptables stop
      chkconfig iptables off
      service iptables status

    13、把mysql加入到service系统服务
      cp $installpath/$packagename/support-files/mysql.server /etc/init.d/mysqld
      chkconfig --add mysqld && chkconfig mysql on

    14、重启服务
      service mysqld restart
      service mysqld status

  • 相关阅读:
    window环境搭建contos 7,而后xshell链接
    .NET Core 学习笔记(二)之启动流程
    .Net Core 学习笔记(一)
    Redis入门指南(附网盘下载链接)
    结构化数据、半结构化数据和非结构化数据
    github上项目的目录结构说明
    数据库分库分表和带来的唯一ID、分页查询问题的解决
    博客目录
    14 SQLAlchemy
    13 Msql之四种事务隔离界别
  • 原文地址:https://www.cnblogs.com/51python/p/16292808.html
Copyright © 2020-2023  润新知