群晖 Mariadb 10 开启远程访问
环境:群晖6.2、MariaDB10
通过 ssh 登陆群晖 输入密码, 切换 root 用户
sudo -i
Password:
进入 MariaDB10 安装目录
cd /volume1/@appstore/MariaDB10/usr/local/mariadb10/bin
输入密码, 登陆数据库
./mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 29 Server version: 10.3.21-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
切换到用户表
use mysql
Database changed
设置任意 ip 都可以使用 root 登陆(我的数据库端口并未向公网开放)
update user set host = '%' where user = 'root';
查询时候设置成功
select host,user from user;
+-----------+------+
| host | user |
+-----------+------+
| % | root |
| 127.0.0.1 | root |
| ::1 | root |
+-----------+------+
3 rows in set (0.001 sec)
刷新缓存
FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.031 sec)
接下来就可以使用管理工具登陆数据库了