Skip to content

Instantly share code, notes, and snippets.

@rahulkumar-aws
Last active July 2, 2018 21:12
Show Gist options
  • Select an option

  • Save rahulkumar-aws/d2e88e0e4616812d77493692a8b05caf to your computer and use it in GitHub Desktop.

Select an option

Save rahulkumar-aws/d2e88e0e4616812d77493692a8b05caf to your computer and use it in GitHub Desktop.
Docker work

docker pull mongo mkdir ~/data sudo docker run -d -p 27017:27017 -v ~/data:/data/db mongo docker exec -it some-mongo bash docker logs some-mongo

docker pull mysql

docker run
--detach
--name=test-mysql
--env="MYSQL_ROOT_PASSWORD=mypassword"
--publish 6603:3306
--volume=/Users/rahulkumar/container/test-mysql/conf.d:/etc/mysql/conf.d
mysql

some error

64 down vote accepted You can change the encryption of the user's password by altering the user with below Alter command :

ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';

OR

We can avoid this error by make it work with old password plugin-

First change the authentication plugin in my.cnf file for Linux / my.ini file in Windows:

[mysqld]

default_authentication_plugin=mysql_native_password

***mkdir -p ~/storage/docker/mysql-datadir

docker run
--detach
--name=test-mysql
--env="MYSQL_ROOT_PASSWORD=pass"
--publish 6603:3306
--volume=/Users/rahulkumar/container/test-mysql/conf.d:/etc/mysql/conf.d
--volume=/Users/rahulkumar/storage/docker/mysql-datadir:/var/lib/mysql
mysql

mysql -uroot -pmypassword -h127.0.0.1 -P6603 -e 'show global variables like "max_connections"';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment