tech-tips/Программное обеспечение/СУБД/MySQL - MariaDB/Разрешить подключаться любому юзеру к mysql удалённо.md

24 lines
684 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

В файле `/etc/mysql/mysql.conf.d/mysqld.cnf` (или `/etc/mysql/mariadb.conf.d/50-server.cnf`) задать параметр:
```shell
bind-address=0.0.0.0
```
Перезагрузить конфиги #mysql или весь mysql:
```shell
systemctl reload mysql
# или
systemctl restart mysql
```
Подключиться к БД и выполнить:
```SQL
update mysql.user set host='%', plugin='' where user='username';
flush privileges;
```
> [!seealso]
> [Under MySQL 8.0. Give the new user all permissions for all privileges, and then cancel the error ERROR1227 : SYSTEM_USER privilege(s) for this operation](http://programmersought.com/article/26621841193/)