群晖nas php mariadb,群晖MariaDB添加远程访问功能

群晖的套件中安装的MariaDB10,远程访问默认关闭的,可以通过以下命令开启。

首先进入群晖控制台开机SSH服务 控制面板--终端机和SNMP--终端机--启用SSH功能 勾选

c33cc26980181b9c41fc038665e1d785.png

然后使用客户端putty SSH登陆到群晖Eagle@Eagle:~$ sudo -i

root@Eagle:~# cd /volume1/@appstore/MariaDB10/usr/local/mariadb10/bin

root@Eagle:~# ./mysql -u root -p

root@Eagle:/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 230

Server version: 10.3.11-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)]>

MariaDB [(none)]>

MariaDB [(none)]> show databases;

+--------------------+

| Database           |

+--------------------+

| glpi               |

| information_schema |

| mysql              |

| performance_schema |

+--------------------+

4 rows in set (0.029 sec)

MariaDB [(none)]> use mysql;

Database changed

MariaDB [mysql]> select User,host from mysql.user;

+-----------+-----------+

| User      | host      |

+-----------+-----------+

| root      | 127.0.0.1 |

| root      | ::1       |

| glpi_user | localhost |

| root      | localhost |

+-----------+-----------+

4 rows in set (0.018 sec)

MariaDB [mysql]> update user set host="%" where user="root" and host="localhost";

Query OK, 1 row affected (0.001 sec)

Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [mysql]>

MariaDB [mysql]> select User,host from mysql.user;

+-----------+-----------+

| User      | host      |

+-----------+-----------+

| glpi_user | %         |

| root      | %         |

| root      | 127.0.0.1 |

| root      | ::1       |

+-----------+-----------+

4 rows in set (0.001 sec)

MariaDB [mysql]>

MariaDB [mysql]> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.001 sec)

MariaDB [mysql]>

然后使用客户端就可以远程登陆了

cf4ca4e6036fb5399d762beb8bad8215.png

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值