Darren Finch
Darren Finch

Reputation: 9

Docker mysql, added persistent storage and will not read my.cnf stored locally

Trying to add persistent volume for db storage and then read my.cnf. The storage mounts fine but I cant seem to get a second mount added (even if I add second persistent volume).


docker run -v /Volumes/Lacie/xxSQLbin:/mysql -v /Volumes/Lacie/xxSQLbin:/my.cnf  -e MYSQL_ROOT_PASSWORD=myPass -d -p 3307:3306 --name db mysql

2nd issues, I cant seem to get passed this error when I try writing to DB from command line (bash)

mysql: [Warning] Using a password on the command line interface can be insecure.

I tried to set mySQL_PASSWORD but not able to connect, my local my.cnf file : [mysqld]

show_warnings=false

datadir             =/mysql/mysql/

log_error           =/mysql/logmysql_error.log
general_log_file    =/var/mysql.log
general_log         =1
slow_query_log      =1
slow_query_log_file =/mysql/mysql_slow.log

bind-address = 0.0.0.0
mysqlx-bind-address = 0.0.0.0

[client]
user=user
password=password
host=127.0.0.1

[mysqldump]
user=root
password=password
port=3306
host=127.0.0.1

I have tried to add 2nd persistent storage and the second -v seems to always get ignored.

I have not tried using docker-compose - would I have better control

Sorry for the newbie questions - docker is new to me and am learning as I go :-)

Upvotes: 0

Views: 22

Answers (0)

Related Questions