<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      自動化安裝mysql

      目錄結構

      [root@20230703-instance mysql]# ll
      總用量 20
      -rw-r--r-- 1 mysql mysql  547 7月  14 13:22 config
      -rwxr-x--- 1 mysql mysql 2625 7月  14 13:22 install.sh
      -rw-r--r-- 1 mysql mysql 1777 7月  14 13:22 my5.7.cnf
      drwxr-xr-x 2 mysql mysql 4096 7月  14 13:22 pkg
      -rwxr-xr-x 1 mysql mysql  917 7月  14 13:22 uninstall.sh
      
      [root@20230703-instance mysql]# ll pkg
      總用量 218448
      -rw-r--r-- 1 mysql mysql     24372 7月  14 13:22 libaio-0.3.109-12.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     12776 7月  14 13:22 libaio-devel-0.3.109-12.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql  26597364 7月  14 13:22 mysql-community-client-5.7.34-1.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql    317444 7月  14 13:22 mysql-community-common-5.7.34-1.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql   2472844 7月  14 13:22 mysql-community-libs-5.7.34-1.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql 181833876 7月  14 13:22 mysql-community-server-5.7.34-1.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql    311020 7月  14 13:22 net-tools-2.0-0.17.20131004git.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     30840 7月  14 13:22 numactl-libs-2.0.12-5.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql   8352488 7月  14 13:22 perl-5.16.3-286.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     19672 7月  14 13:22 perl-Carp-1.26-244.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     19244 7月  14 13:22 perl-constant-1.27-2.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     48296 7月  14 13:22 perl-Data-Dumper-2.145-3.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql   1545440 7月  14 13:22 perl-Encode-2.51-7.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     29092 7月  14 13:22 perl-Exporter-5.68-3.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     27088 7月  14 13:22 perl-File-Path-2.09-2.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     57680 7月  14 13:22 perl-File-Temp-0.23.01-3.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     78236 7月  14 13:22 perl-Filter-1.49-3.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     57004 7月  14 13:22 perl-Getopt-Long-2.40-2.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     39292 7月  14 13:22 perl-HTTP-Tiny-0.033-3.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql    703436 7月  14 13:22 perl-libs-5.16.3-286.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     43580 7月  14 13:22 perl-macros-5.16.3-286.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     12592 7月  14 13:22 perl-parent-0.225-244.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     84468 7月  14 13:22 perl-PathTools-3.40-5.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     51252 7月  14 13:22 perl-Pod-Escapes-1.04-286.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql    114320 7月  14 13:22 perl-podlators-2.5.1-3.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     88756 7月  14 13:22 perl-Pod-Perldoc-3.20-4.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql    221216 7月  14 13:22 perl-Pod-Simple-3.28-4.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     27436 7月  14 13:22 perl-Pod-Usage-1.63-3.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     36808 7月  14 13:22 perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     49692 7月  14 13:22 perl-Socket-2.010-3.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     78888 7月  14 13:22 perl-Storable-2.45-3.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     14056 7月  14 13:22 perl-Text-ParseWords-3.29-4.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     50392 7月  14 13:22 perl-threads-1.87-4.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     39868 7月  14 13:22 perl-threads-shared-1.43-6.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     52744 7月  14 13:22 perl-TimeDate-2.30-2.el7.noarch.rpm
      -rw-r--r-- 1 mysql mysql     46304 7月  14 13:22 perl-Time-HiRes-1.9725-3.el7.x86_64.rpm
      -rw-r--r-- 1 mysql mysql     24792 7月  14 13:22 perl-Time-Local-1.2300-2.el7.noarch.rpm
      
      
      

      config

      
      [root@20230703-instance mysql]# cat config
      
      # This file controls the state of SELinux on the system.
      # SELINUX= can take one of these three values:
      #     enforcing - SELinux security policy is enforced.
      #     permissive - SELinux prints warnings instead of enforcing.
      #     disabled - No SELinux policy is loaded.
      SELINUX=disabled
      # SELINUXTYPE= can take one of three two values:
      #     targeted - Targeted processes are protected,
      #     minimum - Modification of targeted policy. Only selected processes are protected.
      #     mls - Multi Level Security protection.
      #SELINUXTYPE=targeted
      

      my5.7.cnf

      
      [root@20230703-instance mysql]# cat my5.7.cnf
      [client]
      port		= 3306
      #socket		=/tmp/mysql.sock
      # For advice on how to change settings please see
      # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
      default-character_set=utf8mb4
      
      [mysqld]
      safe-user-create=1
      old_passwords=0
      secure-auth=1
      allow-suspicious-udfs=0
      max_allowed_packet = 67108864
      sql_mode=NO_AUTO_CREATE_USER
      local_infile=0
      auto-increment-offset = 1
      auto-increment-increment = 2
      binlog-ignore-db = performance_schema
      binlog-ignore-db = information_schema
      binlog-ignore-db = mysql
      binlog-do-db = dataassetmnt
      character-set-server=utf8mb4
      read-only = 0
      #binlog_format = mixed
      #log-bin = mysql-bin
      server-id=1
      explicit_defaults_for_timestamp=true
      #TODO
      replicate-ignore-table = replicate-do-db_place.t_login_op_log
      replicate-ignore-table = replicate-do-db_place.t_login_network_card
      replicate-ignore-table = replicate-do-db_place.t_login_network_card_usage
      replicate-ignore-table = replicate-do-db_place.t_login_network_config
      replicate-ignore-table = replicate-do-db_place.t_login_network_config_network_card
      port		= 3306
      # only replicate this db
      #replicate-do-db=scmp_x
      replicate-do-db=replicate-do-db_place
      gtid-mode = ON
      enforce_gtid_consistency=on
      skip_slave_start=0
      
      auto_increment_increment = 1
      auto_increment_offset = 1
      
      expire_logs_days = 7
      
      datadir=/var/lib/mysql
      socket=/var/lib/mysql/mysql.sock
      
      # Disabling symbolic-links is recommended to prevent assorted security risks
      symbolic-links=0
      
      log-error=/var/log/mysqld.log
      pid-file=/var/run/mysqld/mysqld.pid
      
      [mysqldump]
      quick
      max_allowed_packet = 32M
      
      [mysql]
      default-character-set=utf8mb4
      no-auto-rehash
      # Remove the next comment character if you are not familiar with SQL
      
      [myisamchk]
      key_buffer_size = 20M
      sort_buffer_size = 20M
      read_buffer = 2M
      write_buffer = 2M
      #safe-updates
      [root@20230703-instance mysql]#
      

      install.sh

      [root@20230703-instance mysql]# cat install.sh
      #!/bin/bash
      
      ###mysql數據庫的安裝配置
      
      #重復安裝時需要先停止服務
      systemctl stop mysqld
      /etc/init.d/mysql stop
      killall -9 mysql
      killall -9 mysqld_safe
      killall -9 mysqld
      
      #刪除已安裝的文件
      if [ -d /etc/mysql ]; then
        rm -r -f /etc/mysql
      fi
      if [ -d /usr/local/mysql ]; then
        rm -r -f /usr/local/mysql
        rm -r -f /opt/mysql/server-5.5
        rm -r -f /opt/mysql/server-5.6
        rm -r -f /opt/mysql/server-5.7
      fi
      if [ -d /var/lib/mysql ]; then
        rm -rf /var/lib/mysql
      fi
      if [ -f /etc/init.d/mysql ]; then
        rm -f /etc/init.d/mysql
      fi
      if [ -f /etc/init.d/mysqld ]; then
        rm -f /etc/init.d/mysqld
      fi
      if [ -L /usr/local/mysql ]; then
        rm -f /usr/local/mysql
      fi
      
      if [ -f /root/.mysql_secret ]; then
        rm -f /root/.mysql_secret
      fi
      
      rm -rf /var/log/mysql*
      
      #卸載自帶的mysql
      rpm -e --nodeps $(rpm -qa |grep mariadb)
      rpm -e --nodeps $(rpm -qa |grep MySQL)
      rpm -e --nodeps $(rpm -qa |grep mysql)
      
      #創建mysql用戶
      sh -c 'groupadd mysql'
      sh -c 'useradd -r -g mysql mysql'
      
      #安裝mysql程序
      pushd pkg
        rpm -ivh net-tools-2.0-0.17.20131004git.el7.x86_64.rpm
        rpm -ivh libaio*.rpm
        rpm -ivh perl*.rpm
        rpm -ivh perl-Data-Dumper-2.145-3.el7.x86_64.rpm
        rpm -ivh numactl-libs-2.0.12-5.el7.x86_64.rpm
        rpm -ivh mysql-*.rpm
      popd
      
      #my.cnf 默認配置文件
      cp -f my5.7.cnf /etc/my.cnf
      chmod 0444 /etc/my.cnf
      rm /var/lib/mysql/auto.conf
      
      
      #啟動mysql
      mysqld --initialize --user=mysql --console
      systemctl restart mysqld
      
      #設置root用戶密碼
      init_password=`sudo grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}'`
      mysql -uroot -p$init_password --connect-expired-password -e "alter user 'root'@'localhost' identified by 'Release@2023@DataSafeYear'";
      
      #
      username=root
      password=Release@2023@DataSafeYear
      mysql -u$username -p$password -e "drop database if exists test";
      mysql -u$username -p$password -e "set global local_infile='OFF'";
      mysql -u$username -p$password -e "source /usr/setup/smp/sql/dataassetmnt.sql"
      mysql -u$username -p$password -e "source /usr/setup/smp/sql/t_assets_vuln.sql"
      mysql -u$username -p$password -e "source /usr/setup/smp/sql/t_assets_cnnvd.sql"
      mysql -u$username -p$password -e "create user smp@'localhost' identified by 'Release@2023@DataSafeYear'"
      mysql -u$username -p$password -e "grant all privileges on dataassetmnt.* to smp@'localhost' identified by 'Release@2023@DataSafeYear'"
      mysql -u$username -p$password -e "grant select on mysql.* to smp@'localhost' identified by 'Release@2023@DataSafeYear'"
      mysql -u$username -p$password -e "delete from mysql.user where user = 'root'"
      mysql -u$username -p$password -e "flush privileges"
      
      systemctl restart mysqld
      

      uninstall.sh

      [root@20230703-instance mysql]# cat uninstall.sh
      #!/bin/bash
      
      ###mysql數據庫的安裝配置
      
      #重復安裝時需要先停止服務
      systemctl stop mysqld
      /etc/init.d/mysql stop
      killall -9 mysql
      killall -9 mysqld_safe
      killall -9 mysqld
      
      #刪除已安裝的文件
      if [ -d /etc/mysql ]; then
        rm -r -f /etc/mysql
      fi
      if [ -d /usr/local/mysql ]; then
        rm -r -f /usr/local/mysql
        rm -r -f /opt/mysql/server-5.5
        rm -r -f /opt/mysql/server-5.6
        rm -r -f /opt/mysql/server-5.7
      fi
      if [ -d /var/lib/mysql ]; then
        rm -rf /var/lib/mysql
      fi
      if [ -f /etc/init.d/mysql ]; then
        rm -f /etc/init.d/mysql
      fi
      if [ -f /etc/init.d/mysqld ]; then
        rm -f /etc/init.d/mysqld
      fi
      if [ -L /usr/local/mysql ]; then
        rm -f /usr/local/mysql
      fi
      
      if [ -f /root/.mysql_secret ]; then
        rm -f /root/.mysql_secret
      fi
      
      rm -rf /var/log/mysql*
      
      #卸載自帶的mysql
      rpm -e --nodeps $(rpm -qa |grep mariadb)
      rpm -e --nodeps $(rpm -qa |grep MySQL)
      rpm -e --nodeps $(rpm -qa |grep mysql)
      
      [root@20230703-instance mysql]#
      
      posted @ 2023-11-24 15:10  Jzm筆記  閱讀(37)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 在线视频中文字幕二区| 国产午夜福利精品视频| 精品日本乱一区二区三区| 久久久久成人片免费观看蜜芽| 亚洲男人天堂一级黄色片| 啊轻点灬大JI巴太粗太长了在线| 久久精品国产久精国产| 日韩大片高清播放器| 久久一日本道色综合久久| 国产精品国产三级国快看| 99国产欧美另类久久久精品| 亚洲综合无码一区二区三区不卡| 九九热在线免费视频精品| 国产精品午夜福利免费看| 国产真实乱人偷精品人妻| 久热re这里精品视频在线6 | 亚洲精品日韩久久精品| 欧美成人精品手机在线| 天天做天天爱夜夜爽毛片 | 日韩精品国产二区三区| 高清偷拍一区二区三区| 国产视频一区二区| 白白发布视频一区二区视频| 亚洲综合成人av在线| 国产女人和拘做受视频免费 | 国产精品国三级国产av| 小鲜肉自慰网站| 国产蜜臀久久av一区二区| 亚洲国产欧美一区二区好看电影 | 成人欧美一区二区三区在线观看| 五大连池市| julia无码中文字幕一区| 一本大道久久东京热AV| 国产情侣激情在线对白| 国产婷婷综合在线视频中文| 久久被窝亚洲精品爽爽爽| 广州市| 国产一区二区三区高清视频| 四虎影视一区二区精品| 精品久久久久久中文字幕| 久久国产成人精品国产成人亚洲|