scrollmapper / bible_databases

Bible versions and cross-reference databases.
MIT License
1.05k stars 358 forks source link

Cannot access bible_databases container mariadb #65

Closed samtipton closed 2 years ago

samtipton commented 2 years ago

I am unable to connect to the bible_databases container with instructions. Please help!

Running docker-compose up returns

Creating network "bible_databases_default" with the default driver
Creating bible_databases_mariadb_1 ... done
Attaching to bible_databases_mariadb_1
mariadb_1  | 2022-04-02 15:14:17+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.15+maria~focal started.
mariadb_1  | 2022-04-02 15:14:17+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mariadb_1  | 2022-04-02 15:14:17+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.15+maria~focal started.
mariadb_1  | 2022-04-02 15:14:17+00:00 [Note] [Entrypoint]: Initializing database files
mariadb_1  |
mariadb_1  |
mariadb_1  | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
mariadb_1  | To do so, start the server, then issue the following command:
mariadb_1  |
mariadb_1  | '/usr/bin/mysql_secure_installation'
mariadb_1  |
mariadb_1  | which will also give you the option of removing the test
mariadb_1  | databases and anonymous user created by default.  This is
mariadb_1  | strongly recommended for production servers.
mariadb_1  |
mariadb_1  | See the MariaDB Knowledgebase at https://mariadb.com/kb
mariadb_1  |
mariadb_1  | Please report any problems at https://mariadb.org/jira
mariadb_1  |
mariadb_1  | The latest information about MariaDB is available at https://mariadb.org/.
mariadb_1  |
mariadb_1  | Consider joining MariaDB's strong and vibrant community:
mariadb_1  | https://mariadb.org/get-involved/
mariadb_1  |
mariadb_1  | 2022-04-02 15:14:18+00:00 [Note] [Entrypoint]: Database files initialized
mariadb_1  | 2022-04-02 15:14:18+00:00 [Note] [Entrypoint]: Starting temporary server
mariadb_1  | 2022-04-02 15:14:18+00:00 [Note] [Entrypoint]: Waiting for server startup
mariadb_1  | 2022-04-02 15:14:18 0 [Note] mysqld (mysqld 10.5.15-MariaDB-1:10.5.15+maria~focal) starting as process 107 ...
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Uses event mutexes
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Number of pools: 1
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
mariadb_1  | 2022-04-02 15:14:18 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Using Linux native AIO
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Completed initialization of buffer pool
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: 128 rollback segments are active.
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mariadb_1  | 2022-04-02 15:14:18 0 [Note] InnoDB: 10.5.15 started; log sequence number 45106; transaction id 20
mariadb_1  | 2022-04-02 15:14:18 0 [Note] Plugin 'FEEDBACK' is disabled.
mariadb_1  | 2022-04-02 15:14:18 0 [Warning] 'user' entry 'root@feb11f96208e' ignored in --skip-name-resolve mode.
mariadb_1  | 2022-04-02 15:14:18 0 [Warning] 'proxies_priv' entry '@% root@feb11f96208e' ignored in --skip-name-resolve mode.
mariadb_1  | 2022-04-02 15:14:18 0 [Note] Reading of all Master_info entries succeeded
mariadb_1  | 2022-04-02 15:14:18 0 [Note] Added new Master_info '' to hash table
mariadb_1  | 2022-04-02 15:14:18 0 [Note] mysqld: ready for connections.
mariadb_1  | Version: '10.5.15-MariaDB-1:10.5.15+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
mariadb_1  | 2022-04-02 15:14:19+00:00 [Note] [Entrypoint]: Temporary server started.
mariadb_1  | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
mariadb_1  | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
mariadb_1  | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
mariadb_1  | 2022-04-02 15:14:21+00:00 [Note] [Entrypoint]: GENERATED ROOT PASSWORD: s/UT(RH0?|?DR.7BA>x"KPe+BE11zf0d
mariadb_1  | 2022-04-02 15:14:21+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
mariadb_1  | 2022-04-02 15:14:21+00:00 [Note] [Entrypoint]: Creating database bible
mariadb_1  |
mariadb_1  | 2022-04-02 15:14:21+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/bible_version_key.sql
mariadb_1  |
mariadb_1  |
mariadb_1  | 2022-04-02 15:14:21+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/book_info.sql
mariadb_1  | ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PRAGMA foreign_keys=OFF' at line 1

I then run sudo /usr/bin/mysql_secure_installation and set a root user password, keep anon users, test databases, and allow remote login.

Then if I run mysql -h 127.0.0.1 -u root -p bible and provide the newly created password I get:

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

If I do not run mysql_secure_installation and use the random root password I get the same error. What am I doing wrong?

samtipton commented 2 years ago

Okay running docker exec -it <CONTAINER_ID> /bin/bash then running mysql -u root -p -h localhost with random generated password gets me to the MariaDB prompt. Now I need to figure out how to use this image in my own docker compose application and setup and address the container from my other container.