Synology MARIADB10 turn on the remote access function

https://blog.csdn.net/catoop/article/details/86694473

 

 

After installing Synology MariaDB10, by default only supports the unit is connected, that is, your computer is not connected on the LAN, the LAN connection if needed, treatment needs to be done.

Environment: Synology 6.2, MariaDB10

Approach:
1, using ssh to log in to Synology
2, enter the default installation directory MariaDB

cd / volume1 / @ the AppStore / MariaDB10 / usr / local / mariadb10 / bin
1
3, using the root login MariaDB, and then modify

root@HOME-NAS:/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 20
Server version: 10.3.7-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.053 sec)

MariaDB [MySQL]>
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
14
15
16
. 17
18 is
. 19
20 is
21 is
22 is
23 is
24
25
26 is
27
28
wherein the host is% not to limit the IP, you can set a specific IP address or segment 192.168.1.% so.
Further, the above appears ERROR 1062 (23000): Duplicate entry '% -root' for key 'PRIMARY' disregarded, which means that host the primary key, duplicate values can not be set. So we then query host or three different values. Update statement just executed successfully modified the database only piece of data.

4, do not need to restart the service, you can connect login.

(END)
---------------------
Author: catoop
Source: CSDN
Original: https://blog.csdn.net/catoop/article/details/86694473
copyright Disclaimer: This article is a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/xupanfeng/p/11280230.html