ubuntu 安装 mariadb

1
sudo apt install mariadb-server

等待安装完成即可。

安装过程中没有提示输入密码等设置则进行下面的手动设置。

1
sudo mysql -uroot -p
1
2
3
4
Enter password:  //直接回车
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 44
Server version: 10.1.29-MariaDB-6 Ubuntu 18.04
1
2
use mysql
update user set Password=PASSWORD('password'), plugin='mysql_native_password' where User='root' and Host='localhost'