[Support] UNRA1DUser - MySQL


Recommended Posts

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 by UNRA1DUser
Link to comment
  • 1 month later...

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";`

image.png.16133fc8e74ba20919ceb45638a578f8.png

 

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:'

image.thumb.png.e283e783157b12ec3c1b40ca9b63fc5c.png

 

click apply, the docker auto restarts

image.png.d7fb035167be172f71c009c651c903e5.png

 

Done...

Edited by GigaTech
Update
  • Like 1
Link to comment
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";`

image.png.16133fc8e74ba20919ceb45638a578f8.png

 

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:'

image.thumb.png.e283e783157b12ec3c1b40ca9b63fc5c.png

 

click apply, the docker auto restarts

image.png.d7fb035167be172f71c009c651c903e5.png

 

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=""

Link to comment
  • UNRA1DUser changed the title to [Support] UNRA1DUser - MySQL

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.