A small image with mysql, mysql-client cli and bash using Alpine 3.3.
340
A small image with mysql, mysql-client cli and bash using Alpine 3.3. Optimized for low memory (512MB) installations.
# root/empty password
docker run --name="mysql" -v /data/mysql:/app --restart="always" -d grgichtran/mysql
# get bash inside container
docker exec -it mysql bash
# container bash
$ mysql -u root -p
# get bash inside container
docker exec -it mysql bash
# container bash
$ mysql -u root -p
# execute this
USE mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
UPDATE user SET password=PASSWORD("new-root-password") WHERE User='root';
FLUSH PRIVILEGES;
quit;
# copy file out of container
docker cp mysql:/etc/mysql/my.cnf .
# edit
vi my.conf
# copy file back into container
docker cp my.cnf mysql:/etc/mysql/my.cnf
Content type
Image
Digest
Size
53.8 MB
Last updated
over 9 years ago
docker pull grgichtran/mysql