时间:2021-07-01 10:21:17 帮助过:21人阅读
2.创建启动脚本
-bash-4.1$ more mysql_db_startup.sh
#!/bin/sh
source /opt/mysql/scripts/mysql_env.ini
echo "Startup MySQL Service:localhost_"${HOST_PORT}
/opt/mysql/bin/mysqld_safe --defaults-file=/opt/mysql/my.cnf &
-bash-4.1$
3.创建关闭脚本
-bash-4.1$ more mysql_db_shutdown.sh
#!/bin/sh
source /opt/mysql/scripts/mysql_env.ini
echo "Shutdown MySQL Service:localhost_"${HOST_PORT}
/opt/mysql/bin/mysqladmin --defaults-file=/opt/mysql/my.cnf -u${MYSQL_USER} -p${MYSQL_PASS} -hlocalhost shutdown
-bash-4.1$
4.创建快速登陆脚本
-bash-4.1$ more mysqlplus.sh
#!/bin/sh
source /opt/mysql/scripts/mysql_env.ini
echo "Login MySQL Service:localhost_"${HOST_PORT}
/opt/mysql/bin/mysql --defaults-file=/opt/mysql/my.cnf -u${MYSQL_USER} -p${MYSQL_PASS} -h localhost
-bash-4.1$
5.将上述脚本目录 加入PATH环境变量
echo "export PATH=/opt/mysql/scripts/:\$PATH" >> ~/.bash_profile
source ~/.bash_profile
mysql 管理脚本
标签:创建 else default style nbsp shutdown min -- log