sudo apt-get install mysql-server
mysql -u root -p
SHOW DATABASES;
CREATE DATABASE $DB_NAME;
use $DB_NAME;SHOW TABLES;
sudo vi /etc/mysql/my.cnf
将my.cnf文件中的
bind-address = 127.0.0.1
CREATE USER '$USER_NAME'@'%' IDENTIFIED BY '$USER_PASSWORD';GRANT ALL ON $DB_NAME.* TO '$USER_NAME'@'%';