zl程序教程

您现在的位置是:首页 >  其他

当前栏目

群晖 MariaDB10 开启远程登录

2023-02-26 12:26:47 时间

群晖安装 MariaDB10 后,默认仅支持本机连接,也就是说,你的局域网电脑是连接不上的,如果需要局域网连接,需要做处理。

环境:群晖6.2、MariaDB10

(福利推荐:阿里云、腾讯云、华为云服务器最新限时优惠活动,云服务器1核2G仅88元/年、2核4G仅698元/3年,点击这里立即抢购>>>

处理方法:

1、使用 ssh 登录到群晖

2、进入 MariaDB 默认安装目录

cd [email protected]/MariaDB10/usr/local/mariadb10/bin 

3、使用 root 登录 MariaDB,然后进行修改

[email protected]:~$ sudo -i [email protected]:~# cd  [email protected] [email protected]:[email protected]# ls AudioStation  DownloadStation  MailPlus-Server  NoteStation   PHP7.0                      TextEditor    WebStation CloudStation  ffmpeg           MariaDB10        PDFViewer     PHP7.2                      transmission CloudSync     Git              Node.js_v12      Perl          PythonModule                VideoStation Docker        MailClient       Node.js_v8       PhotoStation  SynologyApplicationService  WebDAVServer [email protected]:[email protected]# cd [email protected]/MariaDB10/usr/local/mariadb10/bin [email protected]:[email protected]/MariaDB10/usr/local/mariadb10/bin#  [email protected]:[email protected]/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 14 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.  MariaDB [(none)]> use mysql Database changed MariaDB [mysql]> update user set host = '%' where user = 'root'; ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' MariaDB [mysql]> select host,user from user; +-----------+------+ | host      | user | +-----------+------+ | %         | root | | 127.0.0.1 | root | | ::1       | root | +-----------+------+ 3 rows in set (0.000 sec)  MariaDB [mysql]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.001 sec)  MariaDB [mysql]>  

其中 host 为 % 表示不限制IP,你也可以设置具体的IP地址,或者网段 192.168.1.% 这样。
另外,上面出现的 ERROR 1062 (23000): Duplicate entry ‘%-root’ for key ‘PRIMARY’ 不予理会,其意思是 host 为主键,不能设置重复的值。所以我们后来的查询中,host 还是3个不同的值。刚刚执行的 update 语句只成功修改了数据库中一条数据。

4、不需要重启服务,即可连接登录。

群晖 MariaDB10 开启远程登录


本站部分内容转载自网络,版权属于原作者所有,如有异议请联系QQ153890879修改或删除,谢谢!
转载请注明原文链接:群晖 MariaDB10 开启远程登录

你还在原价购买阿里云、腾讯云、华为云、天翼云产品?那就亏大啦!现在申请成为四大品牌云厂商VIP用户,可以3折优惠价购买云服务器等云产品,并且可享四大云服务商产品终身VIP优惠价,还等什么?赶紧点击下面对应链接免费申请VIP客户吧:

1、点击这里立即申请成为腾讯云VIP客户

2、点击这里立即注册成为天翼云VIP客户

3、点击这里立即申请成为华为云VIP客户

4、点击这里立享阿里云产品终身VIP优惠价

喜欢 (0)
[[email protected]]
分享 (0)