mysql_5.7_yum_install.sh

 1 #!/bin/bash
 2 #by zhangjia
 3 #2019.4.28
 4 #########################
 5
 6 yum  -y localinstall https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
 7 yum install -y mysql-community-server
 8 systemctl start mysqld.service
 9 systemctl enable mysqld.service
10
11 cat /var/log/mysqld.log|grep ‘A temporary password‘
12 #password="ZHj_1203110904"
13 password_old=`grep ‘password‘ /var/log/mysqld.log|grep ‘temporary‘|awk ‘{print $NF}‘`
14 mysqladmin -uroot -p${password_old} password ZHj1203110904!
15 mysql -uroot -pZHj1203110904! -e "grant all on *.* to [email protected]‘%‘ identified by ‘ZHj1203110904\!‘; flush privileges;"
16 mysql -uroot -pZHj1203110904! -e "show databases;"

原文地址:https://www.cnblogs.com/zhj5551/p/11198345.html

时间: 2024-08-14 22:06:57

mysql_5.7_yum_install.sh的相关文章

23.dubbo脚本之stop.sh

#!/bin/bash cd `dirname $0` BIN_DIR=`pwd` cd .. DEPLOY_DIR=`pwd` CONF_DIR=$DEPLOY_DIR/conf SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'` if [ -z "$SERVER_NAME" ]; then     SERVER_NAME=`hostname` fi PID

24.dubbo脚本之server.sh

#!/bin/bash cd `dirname $0` if [ "$1" = "start" ]; then ./start.sh else if [ "$1" = "stop" ]; then ./stop.sh else if [ "$1" = "debug" ]; then ./start.sh debug else if [ "$1" = "res

25.dubbo脚本之restart.sh

#!/bin/bash cd `dirname $0` ./stop.sh ./start.sh

Oracle 11g RAC 二节点root.sh执行报错故障一例

OEL6.X IBM v3500存储多路径配置   http://koumm.blog.51cto.com/703525/1439760 2. 采用RHEL6.5 multipath多路径软件安装采用ASMLIB方式配置ASM共享磁盘成功,但是在第二节点执 行root.sh报如下错误提示,解决方式见3. Disk Group CRS creation failed with the following message:   ORA-15018: diskgroup cannot be creat

当root.sh与ORA-15031相遇

近日处理一个Oracle Grid infrastructure(GI)安装的问题,在执行root.sh过程中失败,并显示下面错误: Disk Group OCR creation failed with the following message: ORA-15018: diskgroup cannot be created ORA-15031: disk specification '/dev/vx/rdsk/dg_db01/lv_vote1' matches no disks    <<

debian和ubuntu的sh dash bash

Ubuntu和debian 的 shell 默认安装的是 dash,而不是 bash.运行以下命令查看 sh 的详细信息,确认 shell 对应的程序是哪个:$ls -al /bin/sh dash 比 bash 更轻,更快.但 bash 却更常用.如果一些命令.脚本等总不能正常执行,有可能是 dash 的原因.比如编译 Android 源代码的时候,如果使用 dash,则有可能编译出错,或者编译的系统不能启动. 通过以下方式可以使 shell 切换回 bash:$sudo dpkg-recon

使用sh库执行shell命令

python中执行shell命令 之前执行shell命令多是通过os.system(shell命令)的方式来执行,比较麻烦. 了解到sh是一个比subprocess好的库,能够执行shell命令 1.查看ip: [[email protected] myblog]# ifconfigeth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 172.31.253.193 netmask 255.255.240.0 broadcas

sh, 批量执行Linux命令

step 1:创建一个sh批处理命令文件 # vim /etc/batch_ssh/install_redis.sh step 2:给当前用户,能够执行sh脚本权限# chmod install_redis.sh 777 step 3: 编写要批量执行的命令,read表示等待前端用户输入,sleep表示等待时间单位为 秒. echo '\n begin to install 01 plugin \n'; yum install cpp -y; echo '\n yum finish instal

linux执行sh报错:$’\r’: 未找到命令的解决

背景 执行.sh脚本时出现$'\r': 未找到命令, 原因 是因为命令直接从windows 复制过来导致的 解决 yum install dos2unix dos2unix **.sh 进行转换 再次执行即可