mysql多实例登陆脚本

#!/bin/bash


if [ "$1" == "" ]
then
echo "Please input mysqld port number 21001-21006"


elif ([ "$1" != "21001" ] && [ "$1" != "21002" ] && [ "$1" != "21003" ]&&[ "$1" != "21004" ] && [ "$1" != "21005" ] && [ "$1" != "21
006" ])
then
echo "Please input mysqld port number 21001-21006"


else
mysql -S /usr/local/mysql/tmp/mysql-$1.sock -uroot -p


fi
~

~


查看开启的数据库脚本:



#!/bin/bash
mysqld_multi --defaults-extra-file=/etc/my_multi.cnf report
~

你可能感兴趣的:(mysql)