if["$1"="start"]; then
function_start_mysql
elif ["$1"="stop"]; then
function_stop_mysql
elif ["$1"="restart"]; then
function_restart_mysql
elif ["$1"="kill"]; then
function_kill_mysql else
printf "Usage: /data0/mysql/${mysql_port}/mysql {start|stop|restart|kill}\n"
fi
修改执行权限
chmod +x /data0/mysql/3306/mysql
启动服务
/data0/mysql/3306/mysql start
登陆到MYSQL创建一个用户
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' IDENTIFIED BY '12345678'