Skip to content
songwutk edited this page May 5, 2023 · 6 revisions

If down docker container and up again, frappe can't run because db connection error.

change data in mysql global_priv table change host column, set value to %

docker exec -it -u0 mariadb /bin/mysql -prootdocker
MariaDB [mysql]> use mysql;
MariaDB [mysql]> select host,user,password from user;
+--------------+-------------+-------------------------------------------+
| Host         | User        | Password                                  |
+--------------+-------------+-------------------------------------------+
| localhost    | mariadb.sys |                                           |
| localhost    | root        | *2D2954754BDCC00EF903F3A2457FCDFBE1162EA0 |
| %            | root        | *2D2954754BDCC00EF903F3A2457FCDFBE1162EA0 |
| 192.168.64.4 | frappe      | *033A297071D7C0D656B88C9FC113C36DCD8CDAF0 |
+--------------+-------------+-------------------------------------------+
4 rows in set (0.009 sec)

MariaDB [mysql]> RENAME USER "frappe"@"192.168.64.4" TO "frappe"@"%";
Query OK, 0 rows affected (0.065 sec)

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.070 sec)

docker exec -it frappe-bench /bin/bash
frappe@32cb6a87420a:/workspace/development$ cd frappe-bench/
frappe@32cb6a87420a:/workspace/development/frappe-bench$ bench db-console

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.9.3-MariaDB-1:10.9.3+maria~ubu2204 mariadb.org binary 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 [frappe]>

Clone this wiki locally