UNRA1DUser Posted January 9 Share Posted January 9 (edited) Support for Docker image MySQL Application: MySQL - https://www.mysql.com/ Docker Hub: https://hub.docker.com/_/mysql GitHub: https://github.com/mysql Documentation: https://dev.mysql.com/doc/ Overview: Official MySQL database container. It allows to set a database and username without using the console. #Root Password: This container creates by default a random root password on initial execution. Open Docker > MariaDB Icon > Logs > Scroll down to "GENERATED ROOT PASSWORD" to find it. #Creating database dumps docker exec some-mysql sh -c 'exec mysqldump --all-databases -uroot -p"$MYSQL_ROOT_PASSWORD"' > /mnt/user/Backups/all-databases.sql #Restoring data from dump files docker exec -i some-mysql sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"' < /mnt/user/Backups/all-databases.sql #Configuration without a cnf file Many configuration options can be passed as flags to mysqld. This will give you the flexibility to customize the container without needing a cnf file. For example, if you want to change the default encoding and collation for all tables to use UTF-8 (utf8mb4) just append the following to the Post Arguments: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci Here is a list of all Server System Variables -> https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html #Repository tags: If you want to install a specific version of mysql, you can simply customize the repository. For example: mysql (is the same like mysql:latest) mysql:5.7 mysql:8.2.0 Edited March 18 by UNRA1DUser Quote Link to comment
GigaTech Posted March 2 Share Posted March 2 (edited) Hi, I need to add/change a line to `my.cnf` secure-file-priv = "" I can find the file by clicking on the docker icon, starting the console and typing `ls -l etc/my.cnf` `-rw-r--r-- 1 root root 1319 Feb 14 02:55 etc/my.cnf` Now we need to edit the file? Also if able to edit and save, will the changes persist across updates? Or get what you say above to work "#Configuration without a cnf file" "just append the following to the Post Arguments" - where are the post args to append to, can you provide a screenshot or clarification? In my case, to verify this setting, in MySQL workbench `SHOW VARIABLES LIKE "secure_file_priv";` Thanks UPDATE: OK worked it out, Edit the docker, at the top change from 'basic view' to 'advanced view' you will then be able to see 'Post Arguments:' click apply, the docker auto restarts Done... Edited March 2 by GigaTech Update 1 Quote Link to comment
UNRA1DUser Posted March 7 Author Share Posted March 7 On 3/2/2024 at 6:01 PM, GigaTech said: Hi, I need to add/change a line to `my.cnf` secure-file-priv = "" I can find the file by clicking on the docker icon, starting the console and typing `ls -l etc/my.cnf` `-rw-r--r-- 1 root root 1319 Feb 14 02:55 etc/my.cnf` Now we need to edit the file? Also if able to edit and save, will the changes persist across updates? Or get what you say above to work "#Configuration without a cnf file" "just append the following to the Post Arguments" - where are the post args to append to, can you provide a screenshot or clarification? In my case, to verify this setting, in MySQL workbench `SHOW VARIABLES LIKE "secure_file_priv";` Thanks UPDATE: OK worked it out, Edit the docker, at the top change from 'basic view' to 'advanced view' you will then be able to see 'Post Arguments:' click apply, the docker auto restarts Done... Sorry for my late response! Yes it´s under the 'advanced view'. I'm glad this has helped. If you remove the "mysqld --log-error=/var/log/mysql/error.log" out of the Post Arguments you wouldn´t get any kind of logs into the folder. Maybe try mysqld --log-error=/var/log/mysql/error.log --secure-file-priv="" Quote Link to comment
GigaTech Posted March 7 Share Posted March 7 I have NOT removed anything, the value was empty, just added my arg to it and sent pic? 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.