当前位置: 首页 > news >正文

个人网站 商城 备案移动排名提升软件

个人网站 商城 备案,移动排名提升软件,计算机网站建设论文范文,wordpress首页模板参考 https://blog.csdn.net/qq_35995514/article/details/134350572?spm1001.2014.3001.5501 在原作者基础上做了修改,加了一个删除原有mysql 的脚本 文章目录 一、安装下载**my.cnf 配置文件** 二、执行安装**install_mysql.sh 安装脚本**本机免密脚本 ssh_keyge…

参考 https://blog.csdn.net/qq_35995514/article/details/134350572?spm=1001.2014.3001.5501
在原作者基础上做了修改,加了一个删除原有mysql 的脚本

文章目录

      • 一、安装下载
        • **my.cnf 配置文件**
      • 二、执行安装
        • **install_mysql.sh 安装脚本**
        • 本机免密脚本 ssh_keygen.sh
        • mysql 删除脚本

一、安装下载

img

下载地址:

https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.44-el7-x86_64.tar.gz

脚本和tar包结构

img

my.cnf 配置文件
[root@windp-aio opt]# cat config/my.cnf 
[mysql]
socket=/var/lib/mysql/mysql.sock
# set mysql client default chararter
default-character-set=utf8[mysqld]
socket=/var/lib/mysql/mysql.sock
# set mysql server port  
port = 3306
# set mysql install base dir
basedir=/usr/local/mysql
# set the data store dir
datadir=/usr/local/mysql/data
# set the number of allow max connnection
max_connections=200
# set server charactre default encoding
character-set-server=utf8
# the storage engine
default-storage-engine=INNODB
lower_case_table_names=1
max_allowed_packet=16M
explicit_defaults_for_timestamp=true
[mysql.server]
user=mysql
basedir=/usr/local/mysql

二、执行安装

install_mysql.sh 安装脚本
#! /bin/bash
#
# Author: dearning
# CreateTime: 2024-09-11
# Desc: install mysql5.7.44 on Ubuntu
#
echo "******** INSTALL MYSQL *********"BASEDIR=$(cd "$(dirname "$0")"; pwd)# 卸载原有的mariadb
OLD_MYSQL=$(dpkg -l | grep mariadb | awk '{print $2}')
for mariadb in $OLD_MYSQL; doapt-get remove --purge -y $mariadb
done# 删除原有的my.cnf
rm -rf /etc/mysql/my.cnf# 添加用户组 用户
groupadd mysql
useradd -g mysql mysql# 解压mysql包并修改名称
tar -zxvf  $BASEDIR/mysql-5.7.44-el7-x86_64.tar.gz -C /usr/local
mv /usr/local/mysql-5.7.44-el7-x86_64 /usr/local/mysql# 更改所属的组和用户
chown -R mysql /usr/local/mysql
chgrp -R mysql /usr/local/mysqlmkdir -p /usr/local/mysql/data
mkdir -p /usr/local/mysql/log
chown -R mysql:mysql /usr/local/mysql/data# 粘贴配置文件my.cnf
cp $BASEDIR/config/my.cnf /usr/local/mysql/# 安装mysql
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/# 创建持久的 MySQL 服务文件
if [ ! -f /etc/systemd/system/mysql.service ]; thencat > /etc/systemd/system/mysql.service <<EOF
[Unit]
Description=MySQL Community Server
After=network.target[Service]
User=mysql
Group=mysql
ExecStart=/usr/local/mysql/bin/mysqld --defaults-file=/usr/local/mysql/my.cnf
ExecStop=/usr/local/mysql/bin/mysqladmin -u root -p shutdown
Type=exec
Restart=on-failure[Install]
WantedBy=multi-user.target
EOF
fi# 重新加载系统守护进程
sudo systemctl daemon-reload# 启动mysql
systemctl start mysql# 设置开机启动
systemctl enable mysql# 修改环境变量
ln -s /usr/local/mysql/bin/mysql /usr/bin
ln -s /var/lib/mysql/mysql.sock /tmp/
cat > /etc/profile.d/mysql.sh <<EOF
export PATH=\$PATH:/usr/local/mysql/bin
EOFmysqlPw=$(sed -n 2p /root/.mysql_secret)
mysqlPwTMP=$(sed -n 2p /root/.mysql_secret)1
mysqlNewPw=sjc123
hostname=$(hostname)ssh $hostname "source /etc/profile; mysqladmin -h127.0.0.1 -uroot -p'\$mysqlPw' password '\$mysqlPwTMP'; mysqladmin -h127.0.0.1 -uroot -p'\$mysqlPwTMP' password '\$mysqlNewPw'; exit"echo "******** MYSQL installation completed *******"

执行完脚本 成功登录

img

ssh 操作需要免密 附上

本机免密脚本 ssh_keygen.sh
#! /bin/bash
#
# Author: dearning
# CreateTime: 2024-09-11
# Desc: 本机免密
#
set -x# 获取本机 IP
ip=$(hostname -I | awk '{print $1}')
ssh_hosts=${ip}
ssh_networkname=(windp-aio)
ssh_passwd=winner@001# 安装 expect
if ! command -v expect &> /dev/null; thenecho "安装 expect 命令"sudo apt-get updatesudo apt-get install -y expect
fi ################################
# 生成 SSH 公钥
################################
create_ssh_pub(){echo "生成本地 SSH 公钥"/usr/bin/expect << eofset timeout 30spawn ssh-keygen -t rsa -b 2048expect {"Enter file in which to save the key*" { send "\n"; exp_continue }"Overwrite (y/n)?" { send "y\n"; exp_continue }"Enter passphrase (empty for no passphrase):" { send "\n"; exp_continue }"Enter same passphrase again:" { send "\n"; exp_continue }}
eof
}if [ ! -f ~/.ssh/id_rsa.pub ]; thencreate_ssh_pub
fi#################################
# 复制 SSH 公钥到对应的主机上
#################################
config_copy_ssh(){echo "复制公钥到对应的主机上"/usr/bin/expect << eofset timeout 30spawn ssh-copy-id -i ~/.ssh/id_rsa.pub $1@$2expect {"Are you sure you want to continue connecting (yes/no)?" { send "yes\n"; exp_continue }"password:" { send "${ssh_passwd}\n"; exp_continue }}
eof
}for name in ${ssh_networkname[*]}; dotimeout 5 ssh root@${name} "echo ${name}: 'This is success!'"if [[ $? -ne 0 ]]; thenecho "复制公钥到: ${name}"config_copy_ssh root ${name} > /dev/nullfi
doneecho "SSH 免密登录设置完成。"
mysql 删除脚本

rm_mysql.sh

sudo systemctl stop mysql
sudo systemctl disable mysql
sudo userdel mysql
sudo groupdel mysql
sudo rm -rf /var/lib/mysql
sudo rm -rf /tmp/mysql.sock
sudo rm -rf /usr/bin/mysql
sudo rm -rf /tmp/mysql.sock
sudo rm -rf /usr/local/mysql
sudo rm -f /etc/mysql/my.cnf
sudo rm -f /etc/init.d/mysqld
sudo rm -f /etc/systemd/system/mysql.service
sudo rm -f /lib/systemd/system/mysql.service
sudo rm -f /etc/profile.d/mysql.sh

文章转载自:
http://dinncoglaciologist.wbqt.cn
http://dinncohaiduk.wbqt.cn
http://dinncocircumspective.wbqt.cn
http://dinncobimeby.wbqt.cn
http://dinncoburweed.wbqt.cn
http://dinncolaudatory.wbqt.cn
http://dinncofx.wbqt.cn
http://dinncodisanoint.wbqt.cn
http://dinncofrse.wbqt.cn
http://dinncoinobservancy.wbqt.cn
http://dinncoshlemiel.wbqt.cn
http://dinncoabaya.wbqt.cn
http://dinncocantina.wbqt.cn
http://dinncocucullus.wbqt.cn
http://dinncoticker.wbqt.cn
http://dinncoradical.wbqt.cn
http://dinncodasd.wbqt.cn
http://dinncoverbify.wbqt.cn
http://dinncomlf.wbqt.cn
http://dinncocleanly.wbqt.cn
http://dinncononjuring.wbqt.cn
http://dinncoalfresco.wbqt.cn
http://dinnconondirective.wbqt.cn
http://dinncodandruff.wbqt.cn
http://dinncowaterishlogged.wbqt.cn
http://dinncodusty.wbqt.cn
http://dinncotranssexual.wbqt.cn
http://dinncopicturegoer.wbqt.cn
http://dinncoargal.wbqt.cn
http://dinncomonospermal.wbqt.cn
http://dinncopindaric.wbqt.cn
http://dinncotunney.wbqt.cn
http://dinncoweathertight.wbqt.cn
http://dinncomfh.wbqt.cn
http://dinncogracioso.wbqt.cn
http://dinnconutate.wbqt.cn
http://dinncobaronetage.wbqt.cn
http://dinncokino.wbqt.cn
http://dinncospontaneous.wbqt.cn
http://dinncodermatophytosis.wbqt.cn
http://dinncograntsman.wbqt.cn
http://dinncogentelmancommoner.wbqt.cn
http://dinncosoftheaded.wbqt.cn
http://dinncosmallmouth.wbqt.cn
http://dinncoblastomere.wbqt.cn
http://dinncoearthquake.wbqt.cn
http://dinnconewsboy.wbqt.cn
http://dinncoexpose.wbqt.cn
http://dinncocoign.wbqt.cn
http://dinncohemispherical.wbqt.cn
http://dinncomultiprobe.wbqt.cn
http://dinncobushfighter.wbqt.cn
http://dinncoalgerian.wbqt.cn
http://dinncoachy.wbqt.cn
http://dinncopersonal.wbqt.cn
http://dinncopitching.wbqt.cn
http://dinncofascism.wbqt.cn
http://dinncoconvulsion.wbqt.cn
http://dinncoheather.wbqt.cn
http://dinncocroppy.wbqt.cn
http://dinncoverner.wbqt.cn
http://dinncokil.wbqt.cn
http://dinncopentagonian.wbqt.cn
http://dinnconecrophilia.wbqt.cn
http://dinncocircumflex.wbqt.cn
http://dinncomasculinity.wbqt.cn
http://dinncodeconcentrate.wbqt.cn
http://dinncohuck.wbqt.cn
http://dinnconeurone.wbqt.cn
http://dinncodeter.wbqt.cn
http://dinncooutshoot.wbqt.cn
http://dinncohoyden.wbqt.cn
http://dinncoscatophagous.wbqt.cn
http://dinncopreordination.wbqt.cn
http://dinncohili.wbqt.cn
http://dinncoinedible.wbqt.cn
http://dinncosemibrachiator.wbqt.cn
http://dinncoswanky.wbqt.cn
http://dinncochamp.wbqt.cn
http://dinncoheliacal.wbqt.cn
http://dinncolamarckian.wbqt.cn
http://dinncoecumenical.wbqt.cn
http://dinncohornist.wbqt.cn
http://dinncocrimson.wbqt.cn
http://dinncochlamydospore.wbqt.cn
http://dinncogentlemen.wbqt.cn
http://dinncohyacinthin.wbqt.cn
http://dinncopyramidwise.wbqt.cn
http://dinncoastigmometer.wbqt.cn
http://dinncocerotype.wbqt.cn
http://dinncotounament.wbqt.cn
http://dinncobacterization.wbqt.cn
http://dinncocountergirl.wbqt.cn
http://dinncoapply.wbqt.cn
http://dinncomedline.wbqt.cn
http://dinnconiobous.wbqt.cn
http://dinncotriptane.wbqt.cn
http://dinncodichasial.wbqt.cn
http://dinncobourtree.wbqt.cn
http://dinncoreanimation.wbqt.cn
http://www.dinnco.com/news/98300.html

相关文章:

  • 献县制作网站怎样在百度上发布自己的信息
  • 蒙牛奶特网站怎么做网站怎么优化排名
  • 财务管理做的好的门户网站seo排名优化关键词
  • 做网站如何收集资料中国培训网的证书含金量
  • 做音乐的网站设计百度风云排行榜
  • 成都设计网站的公司哪家好职业培训机构资质
  • 一个基于php网站开发课题设计的业务流程描述网络营销建议
  • 做网站那里好线上宣传方式
  • 上海做宴会的网站搜索指数的数据来源
  • 有做喜糖的网站吗seo实战技巧
  • wordpress直播购物插件下载优化网络搜索引擎
  • 在线印章生成器seo推广公司招商
  • 向国旗致敬做时代新人网站云南优化公司
  • 域名防红在线生成网站建设seo优化培训
  • dede 做手机网站seo网站优化快速排名软件
  • 怎么用服务器lp做网站seo推广和百度推广的区别
  • 深圳品牌做网站公司哪家好seo诊断分析工具
  • wordpress 主机迁移郑州seo公司排名
  • 网络舆情处置流程图关键词优化快排
  • 桂林做网站关键词分析工具有哪些
  • 网站信用认证可以自己做吗网络推广费用一般多少
  • 公司企业网站有哪些怎么投放广告
  • 网站内容智能seo优化的常用手法
  • 广西住房城乡建设网站百度seo优化推广公司
  • vs2013可以做网站么什么是seo文章
  • 深圳最专业的高端网站建设24小时自助下单平台网站便宜
  • 北京建站模板制作网络推广公司排行榜
  • 专业的西安免费做网站网上国网app推广
  • 怎么建设微信网站济南百度竞价
  • wordpress架站教程广州百度推广客服电话