Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter mysql is error #75

Closed
sasuke6 opened this issue May 27, 2016 · 11 comments
Closed

Enter mysql is error #75

sasuke6 opened this issue May 27, 2016 · 11 comments

Comments

@sasuke6
Copy link

sasuke6 commented May 27, 2016

When I enter the mysql container docker exec -it docker_mysql_1 bash,there is no problem.But if I enter the mysql,there is ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
When I use mysql -u root -p,there is ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
What is the initial password and how to reset it quickly?

@Mahmoudz
Copy link
Member

As you can see from the MySQL Dockerfile we barely modify the original image, however if you need a quick solution, I advice you google this problem as if it's heppening on the original MySQL docker image. And I will try to reproduce this error and investigate it during the next week. I really hope someone can debug it and help you soon.

@Mahmoudz
Copy link
Member

Mahmoudz commented May 27, 2016

@sasuke6 Hi again, I found a reason today to work on this project and I tried to reproduce your error.
It's not actual bug you just need to provide some info for MySQL in the command, so try running this command, it should work:

mysql --user=homestead --password=secret homestead

You can find the username and password in the docker-compose.yml file:

        environment:
            MYSQL_DATABASE: homestead
            MYSQL_USER: homestead
            MYSQL_PASSWORD: secret
            MYSQL_ROOT_PASSWORD: root

@sasuke6
Copy link
Author

sasuke6 commented May 28, 2016

Thanks a lot!

@jakelacey2012
Copy link

Hi I had this issue, this fixed it for me.

I'm just wondering if this happens every time for every developer? If so could we add this to the documentation?

@Mahmoudz
Copy link
Member

Mahmoudz commented Oct 9, 2016

@jakelacey2012 if you feel it needs to be documented, please go ahead and create a new section in the readme about MySQL (example: Use MySQL) and then show all the tips such as how to ssh into that container docker-compose exec mysql bash and how to login to MySQL and see the tables.. show database; use homestead;... Also show some tips on how to access the DB using tools such as Sequel Pro... Just start it and other folks will continue.
Thanks.

@saumya04
Copy link

@Mahmoudz How can I change my mysql password. I've tried changing the password from docker-compose.yml file but the changes doesn't seems to be reflected. Can you help me with it.

@appleboy
Copy link
Member

@saumya04 Delete your container and rebuild again.

$ docker-compose down
$ docker-compose up

@saumya04
Copy link

@appleboy I've tried that already, its not working yet!

@eperiou
Copy link

eperiou commented Apr 13, 2017

I found this command on another question, related to this topic. Supposedly it deletes the data that normally isn't deleted by deleting the old containers and images

docker-compose rm -v

@francoism90
Copy link

This still happens to me, it doesn't update the root password set in docker-compose.xml

@eperiou
Copy link

eperiou commented Apr 27, 2017

Yes, this is because the mysql image creates a volume storing the password, so it needs to be deleted in the event that everything was not set up correctly the first time you composed.
use
docker volume ls
and you can find it and delete it or:
docker-compose rm -v
to remove the volumes created by the docker-compose before composing again

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

No branches or pull requests

7 participants