1. 安装

    sudo apt update

    sudo apt install mariadb-server

  2. 启动

    sudo service mysql start

  3. 配置

    sudo mysql

    use mysql

    grant all privileges on *.* to ‘root’@’%’ identified by ‘password’;

    flush privileges;

    select user,host,password from user;

     

  4. 修改配置

    sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf

    注释 bind-address            = 127.0.0.1

  5. 重启服务

    sudo service mysql restart

  6. 卸载

    sudo apt-get purge mariadb-*

    选择Yes

  7. 数据库重置

    mysql_secure_installation