安装
1 | apt-get install mariadb-server
|
修改配置
1 | vim /etc/mysql/mariadb.conf.d/50-server.cnf
|
修改允许所有IP连接数据库
修改root密码
1 2 | update mysql.user set password=password('ChinaSkill20!') where user='root';
flush privileges;
|
给予远程访问权限
1 2 | GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '您的数据库密码' WITH GRANT OPTION;
flush privileges;
|
默认使用UNIX SOCKET 认证,有些 phpMyAdmin 在登入时会发生 “Access Denied” 错误。我们可以使用原生 MySQL 认证.
1 2 3 | update mysql.user set plugin = 'mysql_native_password' where User='root';
flush privileges;
quit
|
重启
1 | systemctl restart mariadb
|