一、MariaDB的安装
sudo apt-get install mariadb-server
sudo mysql
use mysql;
UPDATE user SET password=password('password') WHERE user='root';
UPDATE user SET plugin='mysql_native_password' WHERE user = 'root';
flush privileges;
exit
sudo systemctl restart mariadb
mysql -u root -p
修改配置文件
nano /etc/mysql/mariadb.conf.d/50-server.cnf
在bind-address前添加#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
重启数据库
service mariadb restart