Mariadb远程登陆配置及问题解决

数据库 发布日期:2024/9/23 浏览次数:1

正在浏览:Mariadb远程登陆配置及问题解决

前言:

  安装过程不再赘述,直接说问题,mysql的远程连接需要解决两个问题:1.允许root用户远程连接。2.允许任意ip远程连接数据库。当然,在测试和解决问题之前,得首先保证你的数据库与远程主机之间的网络通信没有问题,简单的来说,就是互相ping通,其次,为了避免防火墙的干扰,将本地主机和数据库主机的防火墙都关闭,当然,生产环境下防火墙肯定是要打开的,并且需要额外的安全配置。

问题解决:

1.新安装的数据库默认是需要初始化的,在数据库服务启动的情况下,使用下面的命令来进行初始化。

[root@localhost ~]# mysql_secure_installation
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users"text-align: center">Mariadb远程登陆配置及问题解决

如图所示则为允许任意IP连接。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。