June 21, 20242 yr On 6/10/2021 at 9:33 AM, mgutt said: Set Root Password If you like to manually set your root password remove the word "yes" from "Generate Random Password": Then set your password through "Show more settings": Note: This does not allow to change the password. Reset Root Password Edit the container, enable advanced view and add "mysqld_safe --skip-grant-tables" to the Post Arguments and start the container: Open the cotnainer's console and execute the following commands: mariadb -u root Now you are connected to MariaDB. Execute this: FLUSH PRIVILEGES; And finally this: SET PASSWORD FOR root@'localhost' = PASSWORD('your_new_password'); Finally edit the container and remove the "mysqld_safe --skip-grant-tables" part again. want to reset my root password and got this error:
June 21, 20242 yr Author 7 minutes ago, Cryd said: got this error Not sure what you are doing, but it don't seem you are using the steps mentioned in the guide.
June 21, 20242 yr 8 minutes ago, mgutt said: Not sure what you are doing, but it don't seem you are using the steps mentioned in the guide. i put this like u told in the post arguements: press apply and the docker isnt starting the log told me:
June 21, 20242 yr Author 2 hours ago, Cryd said: 2 hours ago, mgutt said: i put this like u told in the post arguements Hmm looks good. Please.try only: --skip-grant-tables
June 22, 20242 yr On 6/10/2021 at 9:33 AM, mgutt said: Set Root Password If you like to manually set your root password remove the word "yes" from "Generate Random Password": Then set your password through "Show more settings": Note: This does not allow to change the password. Reset Root Password Edit the container, enable advanced view and add "mysqld_safe --skip-grant-tables" to the Post Arguments and start the container: Open the cotnainer's console and execute the following commands: mariadb -u root Now you are connected to MariaDB. Execute this: FLUSH PRIVILEGES; And finally this: SET PASSWORD FOR root@'localhost' = PASSWORD('your_new_password'); Finally edit the container and remove the "mysqld_safe --skip-grant-tables" part again. I am trying to reset my Maria root password but when I add the mysqld_safe --skip-grant-tables to the post arguments the Maria server dies right after start and therefore the container stopps again. Here's the end of the logfile: 2024-06-22 9:30:41 0 [Note] Server socket created on IP: '0.0.0.0'. 2024-06-22 9:30:41 0 [Note] Server socket created on IP: '::'. 2024-06-22 9:30:41 0 [ERROR] Incorrect definition of table mysql.event: expected column 'definer' at position 3 to have type varchar(, found type char(141). 2024-06-22 9:30:41 0 [ERROR] mariadbd: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler. 2024-06-22 9:30:41 0 [Note] /usr/bin/mariadbd: ready for connections. Version: '10.11.8-MariaDB-log' socket: '/run/mysqld/mysqld.sock' port: 3306 Alpine Linux 2024-06-22 9:30:42 4 [Warning] Aborted connection 4 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication) 2024-06-22 9:30:42 0 [Note] InnoDB: Buffer pool(s) load completed at 240622 9:30:42 2024-06-22 9:30:42 0 [Note] /usr/bin/mariadbd (initiated by: unknown): Normal shutdown 2024-06-22 9:30:42 0 [Note] InnoDB: FTS optimize thread exiting. 2024-06-22 9:30:42 0 [Note] InnoDB: Starting shutdown... 2024-06-22 9:30:42 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool 2024-06-22 9:30:42 0 [Note] InnoDB: Restricted to 4048 pages due to innodb_buf_pool_dump_pct=25 2024-06-22 9:30:42 0 [Note] InnoDB: Buffer pool(s) dump completed at 240622 9:30:42 2024-06-22 9:30:43 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1" 2024-06-22 9:30:43 0 [Note] InnoDB: Shutdown completed; log sequence number 29657073294; transaction id 103877563 2024-06-22 9:30:43 0 [Note] /usr/bin/mariadbd: Shutdown complete While the two ERROR lines hint at an unfinished upgrade process I don't think these are the reasons for the shutdown the follows since right after the Errors there's a "ready for connections" entry. But I can't figure out why else it would go down like this. and fixing the Errors is not possible since I would need the root password for that to work. The DB is actually still working (using it for my nextcloud) but I would like to add another user and DB to the server in order to utilize it for a second project Does anyone have an idea how I can unlock my root account again or are my only options to dump(backup) the Nextcloud DB and transfer it to a newly created instance? thanks in advance for any tips cheers
July 3, 20242 yr Same here. Lost my pwd and no luck trying the steps provided here. If i add --skip-grant-tables to the parameters, the container is restarted but mariadb itself won't start. Red square. If i DO start it and start the console, the console is immediatly disconnected. I can not do anything.
July 5, 20242 yr I need help, after many days i am almost at the point of giving up. I just cant get the MariaDB Docker to work. But i could naild it down to an Permission error but i have no clue of solving this. Maybe this is the problem why i just cant connect the MariaDB to anytging, i just get an connection timeout (on Nextcloud and Adminer, yes i cant ping the dockers from both sides)
July 5, 20242 yr Found a way to change the root password. The whole parameter thing mentioned above doesnt work for me. Open a putty or ssh connection to unraid, go to the app data folder for mariadb. Edit the custom.conf file, add the entry 'skip-grant-tables' to the [mysqld] block. Save the file & restart the container. Open a console in unraid, enter: mysql enter: use mysql; then: UPDATE user SET `authentication_string` = PASSWORD('myNewPassword') WHERE `User` = 'root'; enter: exit close the console remove the line 'skip-grant-tables' from the custom.conf file, save it. and restart the container Open a new console, now you can enter mysql using: mysql -u root -p enter your password... voila. Edited July 5, 20242 yr by jowi
September 17, 20241 yr On 7/5/2024 at 4:23 PM, jowi said: Found a way to change the root password. The whole parameter thing mentioned above doesnt work for me. Open a putty or ssh connection to unraid, go to the app data folder for mariadb. Edit the custom.conf file, add the entry 'skip-grant-tables' to the [mysqld] block. Save the file & restart the container. Open a console in unraid, enter: mysql enter: use mysql; then: UPDATE user SET `authentication_string` = PASSWORD('myNewPassword') WHERE `User` = 'root'; enter: exit close the console remove the line 'skip-grant-tables' from the custom.conf file, save it. and restart the container Open a new console, now you can enter mysql using: mysql -u root -p enter your password... voila. Thanks a bunch @jowi, that actually did the trick! adding the skip-grant-tables to the custom.conf file and restarting the container made it possible to log into the mariadb server from the containers shell. While the UPDATE command you mentioned did give me an err (about the authentication_string column not being updatable) I managed to reset the root password with the good old FLUSH PRIVILEGES; followed by a ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password'; then I continued like you mentioned by removing the skip-grant-tables parameter from the custom.conf again and do a final restart of the container. BR tax
December 18, 20241 yr Hi, I use the container in conjunction with home assistant docker without any problems. But recently, the mariadb container started to develop a rather high CPU utilization. Htop always states mariadb as container with 20% or so cpu usage. I didn't change any settings in home Assistant. Do you have an idea to lower down CPU consumption? Edited December 18, 20241 yr by fir3drag0n
February 1, 20251 yr Hi I got the same problem with a mariaDB inside e docker container. I don't find the custom.conf file and if I edit configuration files like 50-server.cnf, after a reboot I see the file without my edit. Someone can help me please?
February 19, 20251 yr I have an issue with my mariadb docker container running on my unraid server. It was running for a long time without issues, but something seems to have happened to it. Now it won't start up at all. Help! This is what I get in the logs: ``` cat: /run/mysqld/mysqld.pid: No such file or directory 250215 00:08:48 mysqld_safe Logging to '/config/databases/ed7c28586f1d.err'. 250215 00:08:48 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! ``` I would greatly appreciate any assistance to get this sorted out. Thanks in advance.
February 27, 20251 yr Hi, Today i have started having issues with Mariadb - please see attached screenshot. I am using the latest instances of Mariadb, swag, nextcloud and vaultwarden. I have added "log_error = /config/log/mysql/mariadb-error.log" to the "custom.cnf" in the maria appdata. Using the container console I ran this command "mariadb -uroot -p<PASSWORD>" (with my MYSQL root password). I get this "sh: syntax error: unexpected newline" Any help would be much appreciated. please see attached..
February 27, 20251 yr Author 37 minutes ago, Jono W said: sh: syntax error: unexpected newline Did you use a Windows editor? Probably wrong new lines.
February 27, 20251 yr @mgutt Thanks for your reply. I have fixed it - incorrect password format. 🤦♂️
March 19, 20251 yr I got a problem. I installed this docker with random password generation enabled, as is the default. But I couldn't find the password in the logs anywhere. It's supposed to be printed in the log, but it rightly isn't. So I disabled random password generation and entered my own, as per the instructions. That password is not accepted. Ehm... Okay? It's definitely correct, so if the password I told it to have, is not correct, then what is? I have already tried to reinstall the image, hoping that it would re-setup the root password, which is does not. I basically just want to add another database. At first I assumed one could do that by editing the username/password/database in the docker settings, and it would pickup the new values and create a database accordingly, but it seems those values do very little more than nothing after initial installation. But before that I need to have the root password. How do I get that? I mean actually. So not by looking at the logs, because it's not there.
March 19, 20251 yr On 7/5/2024 at 4:23 PM, jowi said: Found a way to change the root password. The whole parameter thing mentioned above doesnt work for me. Open a putty or ssh connection to unraid, go to the app data folder for mariadb. Edit the custom.conf file, add the entry 'skip-grant-tables' to the [mysqld] block. Save the file & restart the container. Open a console in unraid, enter: mysql enter: use mysql; then: UPDATE user SET `authentication_string` = PASSWORD('myNewPassword') WHERE `User` = 'root'; enter: exit close the console remove the line 'skip-grant-tables' from the custom.conf file, save it. and restart the container Open a new console, now you can enter mysql using: mysql -u root -p enter your password... voila. Unfortunately this no longer works. I don't know if it ever did, but I assume it did. First of all, the command is now `mariadb`, not `mysql`. Secondly, the custom.conf file doesn't exist, and creating one with the required contents doesn't do what you said it would: ``` [mysqld] skip-grant-tables ``` ^That would be the *entire* contents of custom.conf. Result: ``` $ mariadb ERROR 1045 (28000): Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO) $ mariadb -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) $ mariadb -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ``` So what is the *actual* way to (re)set the root password, please?
March 19, 20251 yr Got there in the end. I think the random password generation was a huge mistake to include if it never shows what it actually generates. It would have been better to create a root account with no password, than to create a root password with a magical unknown password. Anyway, the solution. 1. Edit the docker 2. Enable advanced view (top-right corner) 3. In `Post Arguments` enter `--skip-grant-tables` 4. Apply 5. After the docker restarts, open its console 6. Run `mariadb` 7. Run `flush privileges;` 8. Run `alter user 'root'@'localhost' identified by 'new_password';` 9. Run `exit` twice. 10. Edit the docker again 11. Enable advanced view again 12. In `Post Arguments` remove `--skip-grant-tables` 13. Apply And you're done. Now you can feel free to go into the console and do your admin tasks like normal. Again, this shouldn't be neccesary. A docker should not be designed to lock an admin (that's us) out of their administrative tasks by using a password that literally nobody knows, or could ever know. Edited March 19, 20251 yr by thany
March 19, 20251 yr Author 1 hour ago, thany said: I basically just want to add another database I recommended to run each database in its own container. By that you can fully control the used version (maybe one of your applications does not support an mariadb update in the future), you are able to roll-back per database (maybe one of your application updates got broken and you need to roll-back your appdata backup), ram and cpu usage can be monitored on database/application basis, you have multiple logs per database, more parallel threads/performance, etc.
March 19, 20251 yr 6 hours ago, mgutt said: I recommended to run each database in its own container. By that you can fully control the used version (maybe one of your applications does not support an mariadb update in the future), you are able to roll-back per database (maybe one of your application updates got broken and you need to roll-back your appdata backup), ram and cpu usage can be monitored on database/application basis, you have multiple logs per database, more parallel threads/performance, etc. This defeats the purpose of having a separate docker for the database of an application. Authors of dockers for applications are generally reluctant to embedding a database server within the same docker, and recommend to run a database server separately. I understand why, but having an entire mariadb instance for each database totally defeats their reasoning, and a general sense of effeciency.
March 20, 20251 yr Author 4 hours ago, thany said: I understand why, but having an entire mariadb instance for each database totally defeats their reasoningI understand why, but having an entire mariadb instance for each database totally defeats their reasoning, and a general sense of effeciency. The primary reason to outsource container components is less maintaining. In addition the user can decide which component he uses (in case of a database mariadb, PostgreSQL, etc). I don't think the devs really think about the amount of containers you are using to use their application. And the efficiency does not really suffer as databases are optimized on multi-threading. This means they already create as many processes/caches depending on the amount of databases and queries. Of course there will be more main processes, but I don't think they cause measurable more cpu load compared to a single main process. And i you ever face a problem as described in my last post (I already did twice), you have a much better ways in solving issues, monitoring performance and doing custom mariadb configurations. An example: After having 5 applications using the same database. Which of them causes high ram usage? Which of them causes high cpu usage? Which of them cause reaching the thread pool limit (has much more queries compared to others)? Which of them use how much storage space? And talking about restoring backups. You need to backup each database with sql commands or you are not able to roll-back a single application. I only need to copy the directory of the applications database, which is backed up by the usual backup routine. So yeah, there are maybe a handful more backgrounds processes, but efficiency can mean many things.
March 31, 20251 yr Hi, I am running the newest version Of MDB Official, or at least i try. Since the Update the container wont start, but i cant loose the database. any idea how to fix it? Log: 2025-03-31 20:19:39 0 [Note] Starting MariaDB 11.7.2-MariaDB-ubu2404 source revision 80067a69feaeb5df30abb1bfaf7d4e713ccbf027 server_uid Tnq7keT8GKDxmAtaGW699QQYKjk= as process 1 2025-03-31 20:19:39 0 [Note] InnoDB: Compressed tables use zlib 1.3 2025-03-31 20:19:39 0 [Note] InnoDB: Using transactional memory 2025-03-31 20:19:39 0 [Note] InnoDB: Number of transaction pools: 1 2025-03-31 20:19:39 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions 2025-03-31 20:19:39 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 0 2025-03-31 20:19:39 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF 2025-03-31 20:19:39 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB 2025-03-31 20:19:39 0 [Note] InnoDB: Completed initialization of buffer pool 2025-03-31 20:19:39 0 [Note] InnoDB: Buffered log writes (block size=512 bytes) 2025-03-31 20:19:39 0 [Note] InnoDB: End of log at LSN=37776 2025-03-31 20:19:39 0 [Note] InnoDB: Opened 3 undo tablespaces 2025-03-31 20:19:39 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active. 2025-03-31 20:19:39 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ... 2025-03-31 20:19:39 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB. 2025-03-31 20:19:39 0 [Note] InnoDB: log sequence number 37776; transaction id 4 2025-03-31 20:19:39 0 [Note] Plugin 'FEEDBACK' is disabled. 2025-03-31 20:19:39 0 [Note] Plugin 'wsrep-provider' is disabled. 2025-03-31 20:19:39 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool 2025-03-31 20:19:39 0 [Note] InnoDB: Buffer pool(s) load completed at 250331 20:19:39 2025-03-31 20:19:39 0 [ERROR] Can't open and lock privilege tables: Can't find file: './mysql/servers.MAI' (errno: 2 "No such file or directory") 2025-03-31 20:19:41 0 [Note] Server socket created on IP: '0.0.0.0'. 2025-03-31 20:19:41 0 [Note] Server socket created on IP: '::'. 2025-03-31 20:19:41 0 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/db.MAI' (errno: 2 "No such file or directory") 2025-03-31 20:19:41 0 [ERROR] Aborting 2025-03-31 20:19:38+02:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.7.2+maria~ubu2404 started. 2025-03-31 20:19:39+02:00 [Note] [Entrypoint]: MariaDB upgrade (mariadb-upgrade or creating healthcheck users) required, but skipped due to $MARIADB_AUTO_UPGRADE setting ** Press ANY KEY to close this window ** Start Command: docker run -d --name='MariaDB-Official' --net='bridge' --pids-limit 2048 --privileged=true -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e HOST_HOSTNAME="VOID" -e HOST_CONTAINERNAME="MariaDB-Official" -e 'MARIADB_DATABASE'='REDACTED' -e 'MARIADB_USER'='REDACTED' -e 'MARIADB_PASSWORD'='REDACTED' -e 'MARIADB_ROOT_PASSWORD'='REDACTED' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.icon='https://github.com/mgutt/unraid-docker-templates/raw/main/mgutt/images/mariadb.png' -p '3306:3306/tcp' -v '/mnt/user/appdata/mariadb-official-nc/data':'/var/lib/mysql':'rw' -v '/mnt/user/appdata/mariadb-official-nc/config':'/etc/mysql/conf.d':'rw' --user=99:100 --memory=2G 'mariadb' Does anyone know what i can do to fix it? What i already ckecked: - Forced update did not helped. - Parity is valid. - rebooted Server - removed power from server for more than 15 min Specs: - Unraid Version 7.0.1 - M/B: ASUSTeK COMPUTER INC. PRIME X299-A II Version Rev 1.xx s/n 190857319200374 - BIOS: American Megatrends Inc. Version 1403 Dated 05/23/2022 - CPU: Intel® Core™ i9-9940X CPU @ 3.30GHz - HVM: Enabled - IOMMU: Enabled - Cache: L1-Cache: 0 KiB, L2-Cache: 0 KiB, L3-Cache: 0 KiB - Memory: 32 GiB DDR4 (max. installable capacity 3072 GiB) - Network: bond0: fault-tolerance (active-backup), mtu 1500 - Kernel: Linux 6.6.78-Unraid x86_64 - OpenSSL: 3.4.1 As i said, if anyone kows something, please help.
April 1, 20251 yr I am having issues with my MariaDB docker. I am not sure how long it has been happening. Right now, I cannot start, remove, or configure the docker container. I did not try to rename the container. I do have auto update for docker containers enabled, if it was possibly an update that caused the issue. I also have appdata backups that I can try to restore from if it is unrecoverable. Before attempting to configure or delete the container, I made a copy of the MariaDB-Official folder under appdata. UnRaid 7.0.0 From the log: "Error response from daemon: can not get logs from container which is dead or marked for removal" When starting: When I try to delete: If I try to reconfigure: docker create --name='MariaDB-Official' --net='bridge' --pids-limit 2048 -e TZ="America/Chicago" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Tower" -e HOST_CONTAINERNAME="MariaDB-Official" -e 'MARIADB_RANDOM_ROOT_PASSWORD'='Yes' -e 'MARIADB_DATABASE'='photoprism' -e 'MARIADB_USER'='photoprism' -e 'MARIADB_PASSWORD'='*****' -e 'MARIADB_ROOT_PASSWORD'='*****' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.icon='https://github.com/mgutt/unraid-docker-templates/raw/main/mgutt/images/mariadb.png' -l 'Container'='PhotoPrism' -p '3306:3306/tcp' -v '/mnt/cache/appdata/mariadb-official/data':'/var/lib/mysql':'rw' -v '/mnt/cache/appdata/mariadb-official/config':'/etc/mysql/conf.d':'rw' --user=99:100 --memory=2G 'mariadb' Error response from daemon: Conflict. The container name "/MariaDB-Official" is already in use by container "a36ecc17e0f22dbb129841b053be336e40b191694e58d36bddd64d3bdb274325". You have to remove (or rename) that container to be able to reuse that name. The command failed. Edited April 1, 20251 yr by loosenut76
April 1, 20251 yr Author Enable advanced view. I think there will be a list of unused containers which use the same image. Delete them first.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.