Skip to content

SQLSTATE[HY000] [1130] Host '172.19.0.8' is not allowed to connect to this MariaDB server #18

Closed

Description

@Riyenz

After freshly setting up appwrite on my local and try to test the sign up functionality. I encountered the error "SQLSTATE[HY000] [1130] Host '172.19.0.8' is not allowed to connect to this MariaDB server. Screenshot below:
image

Docker Running

image

Initial checking on MariaDB.

image

Here's a video on how to recreate the issue.
https://www.loom.com/share/98b4c62fc0864d2c81e0a902aa226078

I execute the all.sql and set root password to password but still cant connect.
image

UPDATE -> RESOLVED
so after executing all.sql and set a root password. all you need to do is to create user with % which means "every IP are allowed"

mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'password';
mysql> grant all on *.* to 'root'@'%';

Activity

  1. eldadfux commented on Sep 11, 2019

    @eldadfux
    Member

    Should check and see how we can add this solution by default to the appwrite/mariadb image in this repo:
    https://github.com/appwrite/docker-mariadb

    I am marking this issue as 'help-wanted', if no help is out there I will probably get to it after solving other more urgent issues.

  2. added
    bug
    help wanted
    on Sep 11, 2019
  3. added
    hacktoberfest
    on Sep 21, 2019
  4. jbehrens94 commented on Sep 25, 2019

    @jbehrens94

    Doesn't look like a good idea to me to just use root@%. Instead, I presume this bug to be caused by underlying MySQL changes in password systematics since MySQL 8.0. Can somebody confirm this? I haven't had time to look into the repository itself and this error reminded me directly of a MySQL issue I had in 8.0.

  5. eldadfux commented on Sep 30, 2019

    @eldadfux
    Member

    Me & @christyjacob4 have fixed some issues we found in the DB directory. It seems like the Appwrite container have changed the DB directory read & write permissions on some linux distributions.

    You can take a look at the fix in this commit: #37

    This fix will be released in upcoming version 0.2.0 and theres a good chance it might help with this issue as well.

    @Riyenz let me know if you can test this against the dev (master) version.

  6. mostafahussein commented on Oct 8, 2019

    @mostafahussein
    Contributor

    I am working through the master branch of this repository and this issue does not exist anymore. I am wondering which part of the mentioned PR solved it?

  7. eldadfux commented on Oct 8, 2019

    @eldadfux
    Member

    @mostafahussein We have seen this issue happening only in a few setups, still waiting for @Riyenz to confirm this has solved his original problem.

    This set of commits were attempting to solve a similar (or the same?) issue @christyjacob4 had:
    f739f4e#diff-3254677a7917c6c01f55212f86c57fbf
    b5d4692#diff-3254677a7917c6c01f55212f86c57fbf
    8fe3291#diff-3254677a7917c6c01f55212f86c57fbf

    @christyjacob4 has seen that the Appwrite container was changing DB permissions in his setup and by that denying MariaDB from accessing the DB storage.

  8. Riyenz commented on Oct 8, 2019

    @Riyenz
    Author

    @eldadfux will try now from fresh setup. it might take a while.

  9. eldadfux commented on Oct 8, 2019

    @eldadfux
    Member

    🤞

  10. Riyenz commented on Oct 8, 2019

    @Riyenz
    Author

    @eldadfux fresh setup here's my current error.

    image

    I only change one file.
    image

    Expected would be the home page to be displayed with no errors

  11. eldadfux commented on Oct 8, 2019

    @eldadfux
    Member

    @Riyenz You need to make sure you delete your storage directory and remove all previous containers before running the setup script.

  12. Riyenz commented on Oct 8, 2019

    @Riyenz
    Author

    I deleted storage and remove previous containers but still occured.
    image

    image

    I've done the following.

    composer update --ignore-platform-reqs --optimize-autoloader --no-dev --no-plugins --no-scripts
    
    npm install
    
    docker-compose up -d
    
  13. christyjacob4 commented on Oct 8, 2019

    @christyjacob4
    Contributor

    Hey @Riyenz It would be great if you could send us outputs of the following

    1. in the appwrite root list the permissions of the files
    ls -l
    1. Log into the mariadb container use password as rootsecretpassword
    (base) christy@admin:~$ docker exec -it appwrite_mariadb_1 bash
    root@6622670c390e:/ mysql -u root -p  
    Enter password: 
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 13
    Server version: 10.4.4-MariaDB-1:10.4.4+maria~bionic 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 [(none)]> SELECT host, user FROM mysql.user;
    +-----------+------+
    | Host      | User |
    +-----------+------+
    | %         | root |
    | %         | user |
    | localhost | root |
    +-----------+------+
    3 rows in set (0.008 sec)
    
    MariaDB [(none)]> 
    
    
  14. Riyenz commented on Oct 8, 2019

    @Riyenz
    Author

    1

    rienz@pop-os:~/Projects/appwrite(master)$ ls -l
    total 524
    drwxrwxr-x  10 www-data www-data   4096 Oct  8 23:42 app
    -rw-rw-r--   1 rienz    rienz       792 Oct  8 23:42 build.sh
    -rw-rw-r--   1 rienz    rienz      1500 Oct  8 23:42 CHANGES.md
    -rw-rw-r--   1 rienz    rienz      3343 Oct  8 23:42 CODE_OF_CONDUCT.md
    -rw-rw-r--   1 rienz    rienz      2169 Oct  8 23:42 composer.json
    -rw-rw-r--   1 rienz    rienz    113684 Oct  8 23:42 composer.lock
    -rw-rw-r--   1 rienz    rienz      6447 Oct  8 23:42 CONTRIBUTING.md
    drwxrwxr-x   3 rienz    rienz      4096 Oct  8 23:42 docker
    -rw-rw-r--   1 rienz    rienz      1827 Oct  8 23:43 docker-compose.yml
    -rwxrwxr-x   1 rienz    rienz      3033 Oct  8 23:42 Dockerfile
    drwxrwxr-x   5 rienz    rienz      4096 Oct  8 23:42 docs
    -rw-rw-r--   1 rienz    rienz      3951 Oct  8 23:42 gulpfile.js
    -rw-rw-r--   1 rienz    rienz      1525 Oct  8 23:42 LICENSE
    drwxrwxr-x 593 rienz    rienz     20480 Oct  8 23:43 node_modules
    -rw-rw-r--   1 rienz    rienz       361 Oct  8 23:42 package.json
    -rw-rw-r--   1 rienz    rienz    304518 Oct  8 23:42 package-lock.json
    -rw-rw-r--   1 rienz    rienz       503 Oct  8 23:42 phpunit.xml
    drwxrwxr-x   6 www-data www-data   4096 Oct  8 23:42 public
    -rw-rw-r--   1 rienz    rienz      8907 Oct  8 23:42 README.md
    drwxrwxr-x  11 www-data www-data   4096 Oct  8 23:42 src
    drwxr-xr-x   6 root     root       4096 Oct  9 00:26 storage
    drwxrwxr-x   4 rienz    rienz      4096 Oct  8 23:42 tests
    drwxrwxr-x  25 www-data www-data   4096 Oct  8 23:42 vendor
    

    2
    root with password doesnt work. by default it doesnt have a password

    root@5aa16fb8bafa:/# mysql -u root -p
    Enter password: 
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    root@5aa16fb8bafa:/# mysql -u root
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 12
    Server version: 10.4.4-MariaDB-1:10.4.4+maria~bionic 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 [(none)]> SELECT host, user FROM mysql.user;
    +--------------+------+
    | Host         | User |
    +--------------+------+
    | 127.0.0.1    | root |
    | 5aa16fb8bafa |      |
    | 5aa16fb8bafa | root |
    | ::1          | root |
    | localhost    |      |
    | localhost    | root |
    +--------------+------+
    6 rows in set (0.376 sec)
    
    MariaDB [(none)]> 
    
  15. 13 remaining items

  16. slashdotted commented on Oct 19, 2023

    @slashdotted

    Hello,
    I've encountered the same issue while executing a migration from version 1.4.2 to 1.4.5.

    root@host:~/appwrite# docker compose exec appwrite migrate
    Failed to create connection: SQLSTATE[HY000] [1045] Access denied for user 'appwrite'@'XXX.YYY.ZZZ.KKK' (using password: YES)
    

    The _APP_DB_PASS contained two special characters: ! and @. Removing them fixed the problem.

  17. added a commit that references this issue on Sep 24, 2026
  18. added 2 commits that reference this issue on Sep 24, 2026
  19. added a commit that references this issue on Sep 25, 2026
  20. added 3 commits that reference this issue on Sep 25, 2026
  21. added a commit that references this issue on Sep 29, 2026
  22. added 2 commits that reference this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughacktoberfesthelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions