Ubuntu:
#!/bin/bash
echo mysql-server mysql-server/root_password password "PASSWD"|debconf-set-selections
echo mysql-server mysql-server/root_password_again password "PASSWD"|debconf-set-selections
apt-get install mariadb-server python-mysqldb
service mysql restart
mysql_secure_installation mysql -uroot -phtYun@2014<
EOF
在CentOS下:
#!/bin/bash
yum install mariadb mariadb-server MySQL-python -y
systemctl enable mariadb.service
systemctl start mariadb.service
mysqladmin -u root flush-privileges password "PASSWD"
mysql -uroot -phtYun@2014<
#mysql -uroot -p -hlocalhost>/root/adduser.sql
不知道优惠