亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

mysql安裝腳本

發布時間:2020-03-08 03:07:39 來源:網絡 閱讀:131 作者:wx5860cd5b03d42 欄目:系統運維

#!/bin/bash

echo "############################# MySQL installing..........########################"

echo "-----config my.cnf-----"
mv /etc/my.cnf /etc/my.cnf_date +%Y%m%d
SERVER_ID=ifconfig eth0 |grep inet |awk '{print $2}'|awk -F. '{print $3$4}'
Mem=free -m |grep Mem |awk '{print $2}'
SIZE=$[Mem*1/2]
mysqldir=pwd
cat >>/etc/my$ipaddr.cnf<<EOF

[mysqld]
user=mysql
server-id = 1
port = 3306
basedir=${mysqldir}/mysql
datadir=${mysqldir}/mysql/mysql_data
tmpdir = /tmp
skip-external-locking
skip_name_resolve = 1
lower_case_table_names = 1
max_connections = 8000
max_connect_errors = 8000
explicit_defaults_for_timestamp = 1
max_allowed_packet = 256M
interactive_timeout = 1800
wait_timeout = 1800
tmp_table_size = 128M
max_heap_table_size = 128M
query_cache_size = 0
query_cache_type = 0
read_buffer_size = 1M
read_rnd_buffer_size = 2M
binlog_cache_size = 8M
join_buffer_size = 128M
back_log = 600
explicit_defaults_for_timestamp = false
query_cache_wlock_invalidate = OFF
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
#######log set#############
log_error = ${mysqldir}/mysql/log/mysql.log
slow_query_log = 1
slow_query_log_file = ${mysqldir}/mysql/log/slow.log
log_queries_not_using_indexes = 1
long_query_time = 2
expire_logs_days = 7
log-bin=${mysqldir}/mysql/log/mysql-bin
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8

EOF

echo "-----create group and user:mysql-----"
groupadd mysql
useradd -r -g mysql -s /bin/false mysql

echo "----- install dependent package -----"
yum -y install numactl libaio lrzsz wget

#echo "-----Download MySQL-----"
#if [ -d /soft ];then

echo "software dir is exist! Please check!"

#else

mkdir -p /soft

#fi

wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar

echo "-----Unzip MySQL-----"
tar -zxvf mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar
mv mysql-5.7.28-1.el7.x86_64.rpm-bundle mysql

echo "-----create datadir and change owner of dir-----"
mkdir -p mysql/mysql_data
mkdir -p mysql/log
chown -R mysql.mysql /etc/my.cnf
chown -R mysql.mysql ${mysqldir}/mysql/
chown -R mysql.mysql ${mysqldir}/mysql/mysql_data/

echo "-----config profile-----"
echo 'PATH=${mysqldir}/mysql/bin/:$PATH' >> /etc/profile
source /etc/profile

echo "-----initialize MySQL-----"
${mysqldir}/mysql/bin/mysqld --initialize --user=mysql --basedir=${mysqldir}/mysql --datadir=${mysqldir}/mysql/mysql_data/

echo "-----start MySQL-----"
cp ${mysqldir}/mysql/support-files/mysql.server /etc/init.d/mysqld
ln -s ${mysqldir}/mysql/bin/mysql /usr/sbin/mysql
/etc/init.d/mysqld start
#${mysqldir}/mysql/bin/mysqladmin -u root password 'passw0rd'
#echo "-----init password of MySQL-----"
OLD_PWD=cat ${mysqldir}/mysql/log/mysql.log | grep "password is generated" |awk '{print $NF}'
${mysqldir}/mysql/bin/mysqladmin -u root -p${OLD_PWD} password 'admin@admin'
echo "root password is: admin@admin"

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

青州市| 大城县| 门头沟区| 台中县| 城口县| 建瓯市| 汤原县| 定边县| 洞口县| 高碑店市| 聂拉木县| 上蔡县| 玛纳斯县| 黎平县| 出国| 平湖市| 商城县| 得荣县| 隆林| 松江区| 泰州市| 阳东县| 随州市| 巧家县| 镇雄县| 韶关市| 洛阳市| 万安县| 新巴尔虎右旗| 安庆市| 博客| 乐都县| 自贡市| 松江区| 陇西县| 永福县| 吴桥县| 昂仁县| 张北县| 江孜县| 手机|