Sign inSign up

grgichtran/mysql

By grgichtran

•Updated over 9 years ago

A small image with mysql, mysql-client cli and bash using Alpine 3.3.

Image
1

340

grgichtran/mysql repository overview

⁠mysql

A small image with mysql, mysql-client cli and bash using Alpine 3.3. Optimized for low memory (512MB) installations.

⁠get started

# root/empty password
docker run --name="mysql" -v /data/mysql:/app --restart="always" -d grgichtran/mysql

⁠using mysql cli

# get bash inside container
docker exec -it mysql bash

# container bash
$ mysql -u root -p

⁠changing root password

# 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;

⁠configure my.cnf

# 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

Tag summary

Content type

Image

Digest

Size

53.8 MB

Last updated

over 9 years ago

docker pull grgichtran/mysql