最近常用到的命令,太懒不想打太多

1,mysql启动,重启,停止脚本

echo '/usr/local/mysql5/support-files/mysql.server $1'>>/usr/local/mysql5/shell/mysql_server.sh
ln -s /usr/local/mysql5/shell/mysql_server.sh /usr/local/bin/mysql_server
#使用
mysql_server {start|stop|restart|reload|force-reload|status}

2,mysql修改密码

echo '/usr/local/mysql5/bin/mysqladmin -u root password $1'>>/usr/local/mysql5/shell/mysql_pwd.sh
ln -s /usr/local/mysql5/shell/mysql_pwd.sh /usr/local/bin/mysql_pwd
#使用
mysql_pwd 'your_new_password'

暂时这么多,待续。。

05-25 20:39