mgutt Posted March 23, 2023 Author Share Posted March 23, 2023 11 hours ago, Mrtj18 said: I was attempting to sync my kodi installs using this guide https://kodi.wiki/view/MySQL/Setting_up_MySQL Which is useless as it refers to installing MySQL inside an usual OS and not using a container. As I said. I don't think any single additional step is needed, except setting database name, login and password in the container settings and using this information in Kodi to connect to the database. 1 Quote Link to comment
RedReddington Posted April 18, 2023 Share Posted April 18, 2023 I moved my MariaDB data with "cp -r" from an "Unassigned Devices" SSD to "user/appdata" and now have the following error when trying to start the docker: 2023-04-15 12:30:41 0 [ERROR] mariadbd: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied") 2023-04-15 12:30:41 0 [ERROR] mariadbd: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control' 2023-04-15 12:30:41 0 [ERROR] Plugin 'Aria' init function returned error. 2023-04-15 12:30:41 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. 2023-04-15 12:30:41 0 [ERROR] InnoDB: The data file './ibdata1' must be writable 2023-04-15 12:30:41 0 [ERROR] InnoDB: The data file './ibdata1' must be writable 2023-04-15 12:30:41 0 [ERROR] Plugin 'InnoDB' init function returned error. 2023-04-15 12:30:41 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2023-04-15 12:30:41 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-04-15 12:30:41 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded 2023-04-15 12:30:41 0 [ERROR] Failed to initialize plugins. 2023-04-15 12:30:41 0 [ERROR] Aborting Are the folder permissions somehow screwed up when manually copying them, so that they are not readable/writable by the root user? Running "docker exec -it MariaDB-Official mariadb -u root -p" also doesn't help: Error response from daemon: Container 0bc6acbbc6e2bc850bfc6eee6a45ffa3527bbd0c408867c695ab2a966a684f27 is not running. Quote Link to comment
mgutt Posted April 18, 2023 Author Share Posted April 18, 2023 25 minutes ago, RedReddington said: Are the folder permissions somehow screwed up when manually copying them, so that they are not readable/writable by the root user? All files in appdata are extremely sensitive regarding user permissions. MariaDB official does not run as root. It runs with unraids default user permissions 99 (nobody) and group 100 (users): Here is an example of one of my installations: 29 minutes ago, RedReddington said: "cp -r" from an "Unassigned Devices" SSD to "user/appdata" And how did you copy them to the UD SSD? And how is it formatted? If its not a Linux filesystem, all file permissions are lost. At first check your permissions: find /mnt/user/appdata/mariadb-official -ls In the next step correct the permissions if needed: chmod 777 /mnt/user/appdata/mariadb-official/config chmod 777 /mnt/user/appdata/mariadb-official/data chown root:root /mnt/user/appdata/mariadb-official/config chown root:root /mnt/user/appdata/mariadb-official/data find /mnt/user/appdata/mariadb-official -mindepth 2 -exec chown -v 99:100 {} \; find /mnt/user/appdata/mariadb-official -mindepth 2 -type d -exec chmod -v 700 {} \; find /mnt/user/appdata/mariadb-official -mindepth 2 -type f -exec chmod -v 660 {} \; Quote Link to comment
gadget069 Posted April 28, 2023 Share Posted April 28, 2023 I've done a totally newb thing, I lost my acess to my databse. I hsould start with I had a fully functioning database, with nextcloud running. I want to say I'm totally new to unraid and the docker. I am using adminer to access the databse to make change, created users for the nextcloud database and such. I'm alittle more familiar with phpmyadmin and was trying to get that to connect to mairiadb. I was getting frustrated becuase I could not wrap my head around why it wasnt connecting. So in frustration I changed the root user pw inside mariadb beacuse I couldnt find the mariadb password when I set it up. Stupid me found the it too late. Onece I change the pw it kicked me out of mariadb, wanting me to log back in and to connect to a database. The databse is still there running becasue nextcloud is stull functioning. Is there any way to recover this? Quote Link to comment
L0rdRaiden Posted April 28, 2023 Share Posted April 28, 2023 (edited) On 4/18/2023 at 8:45 PM, mgutt said: All files in appdata are extremely sensitive regarding user permissions. MariaDB official does not run as root. It runs with unraids default user permissions 99 (nobody) and group 100 (users): Here is an example of one of my installations: And how did you copy them to the UD SSD? And how is it formatted? If its not a Linux filesystem, all file permissions are lost. At first check your permissions: find /mnt/user/appdata/mariadb-official -ls In the next step correct the permissions if needed: chmod 777 /mnt/user/appdata/mariadb-official/config chmod 777 /mnt/user/appdata/mariadb-official/data chown root:root /mnt/user/appdata/mariadb-official/config chown root:root /mnt/user/appdata/mariadb-official/data find /mnt/user/appdata/mariadb-official -mindepth 2 -exec chown -v 99:100 {} \; find /mnt/user/appdata/mariadb-official -mindepth 2 -type d -exec chmod -v 700 {} \; find /mnt/user/appdata/mariadb-official -mindepth 2 -type f -exec chmod -v 660 {} \; So is that the right way to configure the permissions? How would you do that in a docker compose setup? I'm using PUID and PGID variables but this aren't officially supported by the image. The values of the env variables and in a separated .env file I have configure it like this but I get an error MariaDBNC | 2023-04-28 14:55:39+02:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.12+maria~ubu2004 started. MariaDBNC | 2023-04-28 14:55:40+02:00 [Note] [Entrypoint]: Initializing database files MariaDBNC | 2023-04-28 14:55:40 0 [Warning] Can't create test file /var/lib/mysql/015ed9479080.lower-test MariaDBNC | 2023-04-28 14:55:40 0 [ERROR] mariadbd: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied") MariaDBNC | 2023-04-28 14:55:40 0 [ERROR] mariadbd: Got error 'Can't create file' when trying to use aria control file '/var/lib/mysql/aria_log_control' COMPOSE mariadb: image: mariadb:10.6 container_name: MariaDBNC restart: unless-stopped user: 99:100 command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW healthcheck: test: ["CMD-SHELL", "mysql nextcloud -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'SELECT 1;' || exit 1"] interval: 2s retries: 120 volumes: - /mnt/user/Docker/Nextcloud/mariadb:/var/lib/mysql environment: - TZ - MYSQL_ROOT_PASSWORD - MYSQL_PASSWORD - MYSQL_DATABASE - MYSQL_USER - MARIADB_AUTO_UPGRADE=1 - MARIADB_DISABLE_UPGRADE_BACKUP=1 networks: - nextcloud_network labels: - "com.centurylinklabs.watchtower.enable=true" Edited April 28, 2023 by L0rdRaiden Quote Link to comment
mgutt Posted April 28, 2023 Author Share Posted April 28, 2023 1 hour ago, gadget069 said: I am using adminer to access the databse to make change, created users for the nextcloud database and such. Not a single step of this is needed. The user is created with the name and password you set while editing the container template. Adminer isn't needed at all. 1 hour ago, gadget069 said: Onece I change the pw it kicked me out of mariadb, wanting me to log back in and to connect to a database. The databse is still there running becasue nextcloud is stull functioning. Is there any way to recover this? Resetting the root password? It's described on the first page. Another option would be to install a second maria db container with a different name and different path and do an export / import through Adminer / phpmyadmin with the usual user login. Quote Link to comment
mgutt Posted April 28, 2023 Author Share Posted April 28, 2023 1 hour ago, L0rdRaiden said: I'm using PUID and PGID variables but this aren't officially supported by the image. Variables like this fully depend on the container. And depending on the container it is sometimes USER, UID, PUID etc and as far as I know maria db doesn't have such an option. Regarding your compose question: Ask in the compose support thread. I'm not supporting this plugin. Quote Link to comment
gadget069 Posted April 28, 2023 Share Posted April 28, 2023 6 hours ago, mgutt said: Not a single step of this is needed. The user is created with the name and password you set while editing the container template. Adminer isn't needed at all. Resetting the root password? It's described on the first page. Another option would be to install a second maria db container with a different name and different path and do an export / import through Adminer / phpmyadmin with the usual user login. Thanks for the advice. i was able to get back in, also created a second mariadb to import in to. Still wet behind the ears. Lots to learn. Quote Link to comment
morreale Posted May 12, 2023 Share Posted May 12, 2023 On 7/3/2021 at 4:12 AM, mgutt said: You mean, if you need two databases? Then install the container twice, change the name and the paths in both containers. This would be the easiest option. For example you could name one container "nextcloud_db" and the other "npm_db" and so on. is this the recoomended guidance vs multiple databases inside the same docker isntance? i am currently running a single instance with dbs for nextcloud and photoprism. i did recently had to rebuild due to errors/corruption that i tried to recover from so i am wondering if that was the cause or an update along the way. Quote Link to comment
JonathanM Posted May 12, 2023 Share Posted May 12, 2023 1 hour ago, morreale said: is this the recoomended guidance vs multiple databases inside the same docker isntance? Yes, containers share many resources, so there is negligible waste by duplicating containers, and the benefit of keeping the changeable data separate is clear, especially for recovery like you are doing. If you eat sleep and breathe database building and maintenance, then maybe keeping multiple databases in a single container would be easier for you to manage, but for us mere mortals that often have to resort to copying from backups for disaster recovery, separate containers is the way to go. Quote Link to comment
mgutt Posted May 12, 2023 Author Share Posted May 12, 2023 4 hours ago, morreale said: is this the recoomended guidance vs multiple databases inside the same docker isntance? I think using multiple containers for multiple databases is the best way to go. By that nothing depends on each other. You don't need SQL commands to manually create additional users and databases. You can monitor usage, load and problems for each application separately. You can have different database versions if some applications aren't compatible to most recent versions.... Quote Link to comment
Joshwaaa Posted June 10, 2023 Share Posted June 10, 2023 I am starting over with Mariadb but after I've removed the docker and the image the "add container" page seems to be keeping some old settings including remembering the old pull I did from the repository. How do I make sure that everything is properly deleted before I reinstall it? Also I want to start fresh with Nextcloud but preserve the database specifically for Nextcloud. So second question should I use something like krusader or a file manager to move it out and move it back in after reinstall? Quote Link to comment
funbubba Posted June 10, 2023 Share Posted June 10, 2023 On 6/6/2023 at 9:46 PM, Joshwaaa said: @mgutt I recently upgraded my cache drive to a cache pool but something went haywire even though the cache pool is working. My dockers disappeared so I deleted the docker.img and reinstalled my dockers. Most went right to where I left them but I cannot get nextcloud reconnected to mariadb. Adminer says "MySQL server has gone away". I keep getting a repeating error when view mariadb logs. I can't find any info on the .err cat: /var/run/mysqld/mysqld.pid: No such file or directory 230606 18:23:41 mysqld_safe Logging to '/config/databases/66cb7795ae82.err'. 230606 18:23:41 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! Any ideas of how I can correct this? What does the .err say? This just happened to me a couple of weeks ago but I only just noticed yesterday. My .err said something about "upgrade after crash is not supported" over and over but I was able to get around it. Quote Link to comment
mgutt Posted June 10, 2023 Author Share Posted June 10, 2023 2 hours ago, Joshwaaa said: I am starting over with Mariadb Regarding your Screenshot you are wrong here as you are not using the official container. 2 hours ago, Joshwaaa said: How do I make sure that everything is properly deleted before I reinstall it? After selecting the container through the drop-down, you will see a delete icon. Or go to apps > previous apps and delete the template there (both do the same). But this deletes only your changes on the template. If you want to delete the files, too, then you need to delete the subfolder of the container under /appdata. The file manager plugin is useful in this case. 1 Quote Link to comment
TheFabby Posted June 10, 2023 Share Posted June 10, 2023 Since last update i'm getting. /usr/local/bin/docker-entrypoint.sh: line 592: exec: mysqld_safe: not found Quote Link to comment
Joshwaaa Posted June 10, 2023 Share Posted June 10, 2023 2 hours ago, mgutt said: Regarding your Screenshot you are wrong here as you are not using the official container. After selecting the container through the drop-down, you will see a delete icon. Or go to apps > previous apps and delete the template there (both do the same). But this deletes only your changes on the template. If you want to delete the files, too, then you need to delete the subfolder of the container under /appdata. The file manager plugin is useful in this case. @mgutt I know I was trying to downgrade to get into a non-functioning database so I was using an old repo pull. Then I just deleted mariadb altogether and the image to start fresh. When I went to reinstall it on the apps page it had the old repo and password prefilled making me think there's some remnants around. Quote Link to comment
mgutt Posted June 10, 2023 Author Share Posted June 10, 2023 3 hours ago, Joshwaaa said: I was using an old repo pull Not sure if I made it clear enough. You are using MariaDB from Linuxserver. This is not the official MariaDB container. And this thread is only for the official one. 4 hours ago, TheFabby said: Since last update i'm getting. /usr/local/bin/docker-entrypoint.sh: line 592: exec: mysqld_safe: not found Are you using the official container?! My update was successful. 9 hours ago, Joshwaaa said: I am starting over with Mariadb As far as I remember you used Adminer to manually create multiple databases in a single container. Do not do this! Instead install one MariaDB container per database (simply change the name and paths). This is how containers are meant to use. And of course you should think about daily backups! At least before installing updates! Quote Link to comment
TheFabby Posted June 11, 2023 Share Posted June 11, 2023 (edited) Yep, i'm sure its the official one. Both my MariaDB's won't boot anymore with this same error. Simple update caused this. Edited June 11, 2023 by TheFabby Quote Link to comment
mgutt Posted June 11, 2023 Author Share Posted June 11, 2023 6 hours ago, TheFabby said: Simple update caused this. "mysqld_safe: not found" happens usually if the user tries to reset its root password. Did you try that in the past and forget to undo something? Like a special post argument? Or did you add something to a config file? Quote Link to comment
TheFabby Posted June 11, 2023 Share Posted June 11, 2023 omg i'm such a idiot, forgot about that! Thank you its fixed now Quote Link to comment
SnugglyDino Posted June 25, 2023 Share Posted June 25, 2023 Is there a way to quickly and easily rename a database without losing all the data? Quote Link to comment
showstopper Posted July 23, 2023 Share Posted July 23, 2023 (edited) Hi guys - hoping someone can help me. I changed from macvlan to ipvlan and everything seemed ok. I then tried to update nextcloud and it seems to want to create a new admin account. After further diagnostics I believe the issue is related to MariaDB. I have these error message repeating in the logs: 230723 18:04:59 mysqld_safe Logging to '/config/databases/e571c6533173.err'. 230723 18:04:59 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! I tried to login as root user and i get this error: root@e571c6533173:/# mariadb -u root ERROR 2002 (HY000): Can't connect to local server through socket '/var/run/mysqld/mysqld.sock' (111) root@e571c6533173:/# Can anyone point me in the right direction here? I do not seem to have a 'mysqld.sock' file, so I am not sure where I need to start?! Edited July 23, 2023 by showstopper Quote Link to comment
Killabee44 Posted July 28, 2023 Share Posted July 28, 2023 (edited) On 7/23/2023 at 1:21 PM, showstopper said: Hi guys - hoping someone can help me. I changed from macvlan to ipvlan and everything seemed ok. I then tried to update nextcloud and it seems to want to create a new admin account. After further diagnostics I believe the issue is related to MariaDB. I have these error message repeating in the logs: 230723 18:04:59 mysqld_safe Logging to '/config/databases/e571c6533173.err'. 230723 18:04:59 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! I tried to login as root user and i get this error: root@e571c6533173:/# mariadb -u root ERROR 2002 (HY000): Can't connect to local server through socket '/var/run/mysqld/mysqld.sock' (111) root@e571c6533173:/# Can anyone point me in the right direction here? I do not seem to have a 'mysqld.sock' file, so I am not sure where I need to start?! I am having the same issue. Recently lost all of my containers and had to reinstall (long story) but now mariadb isn't working and I don't have a .sock file either. I do see my databases in the app folder though. Also I was using the linux version but now would like to move to the official one. Is it as easy as copying the database files to the official mariadb appdata folder? Thanks! Edit2: Another layer to this. I have multiple databases in the linuxserver install of Mariadb as well. I know now not to ever do this but is as easy as installing the two official Mariadb containers (with different name and paths) and then copying the different DB folder from the linuxserver into the data folder of each new official Mariadb install? Edited July 28, 2023 by Killabee44 Quote Link to comment
showstopper Posted July 28, 2023 Share Posted July 28, 2023 1 hour ago, Killabee44 said: I am having the same issue. Recently lost all of my containers and had to reinstall (long story) but now mariadb isn't working and I don't have a .sock file either. I do see my databases in the app folder though. Also I was using the linux version but now would like to move to the official one. Is it as easy as copying the database files to the official mariadb appdata folder? Thanks! Edit2: Another layer to this. I have multiple databases in the linuxserver install of Mariadb as well. I know now not to ever do this but is as easy as installing the two official Mariadb containers (with different name and paths) and then copying the different DB folder from the linuxserver into the data folder of each new official Mariadb install? Hey. So unfortunately these forums seem to be a bit of a ghost town recently! I am sure I have done something wrong with my new server setup that has broken everything, and I initially blamed macvlan. I actually think the mover is breaking my dockers. So, today, I will be deleting some dockers, and making sure only the cache drive is used for Appdata, Domains & System. I'll kick off the mover, then delete some dockers, and start again. I think with the multiple databases, you can do it that way, but I think they recommend 1 mariadb per database is that it is potentially easier to manage! I'm not really a db guy so I am not sure if you can do what you want to do. It sounds like a permissions issue though. Quote Link to comment
mgutt Posted July 28, 2023 Author Share Posted July 28, 2023 31 minutes ago, showstopper said: So unfortunately these forums seem to be a bit of a ghost town recently! A little feedback on that: This is not a place to help users of other containers like the one of Linuxserver and users using the command line to create multiple databases are additional special scenarios I'm not really willed to help only because some YouTubers are spreading bad How-Tos 1 hour ago, Killabee44 said: copying the different DB folder This is not recommend. Create dumps from each database. You can use phpmyadmin, HeidiSQL (Windows), Adminer, Command Line ... 1 Quote Link to comment
Recommended Posts
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.