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

Can't login to PHPMyAdmin #754

Closed
kp77 opened this issue Apr 6, 2017 · 26 comments · Fixed by #775
Closed

Can't login to PHPMyAdmin #754

kp77 opened this issue Apr 6, 2017 · 26 comments · Fixed by #775

Comments

@kp77
Copy link

kp77 commented Apr 6, 2017

A few days ago I didn't have this problem, but I cloned laradock yesterday and built new images. Since then I can't login to PHPMyAdmin.

Previously, I could enter either the short version of the container ID hash or the container name (laradock_mysql_1) as Server and it worked. Now if I do this I get this error:

#2005 - Unknown MySQL server host 'laradock_mysql_1' (-2)

I also tried with localhost and 127.0.0.1, but then I get this error on the PHPMyAdmin login page:

#2002 - Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory") — The server is not responding (or the local server's socket is not correctly configured).

Interestingly, I can connect with HeidiSQL without problems using localhost, so my guess is this is related to PHPMyAdmin.

@mauro-ni
Copy link

mauro-ni commented Apr 6, 2017

I have the same issue since laradock v. 5.1.0

@zeroc0d3
Copy link
Member

zeroc0d3 commented Apr 6, 2017

Could you try this:
docker-compose build && docker-compose up -d nginx mysql phpmyadmin

Perhaps it will help

@mauro-ni
Copy link

mauro-ni commented Apr 6, 2017

This is what i did:
docker-compose build --no-cache nginx mysql phpmyadmin workspace php-fpm applications
docker-compose up -d nginx mysql phpmyadmin

@kp77
Copy link
Author

kp77 commented Apr 6, 2017

@maurosbu
@zeroc0d3
I tried these, but I get the same error.

@mauro-ni
Copy link

mauro-ni commented Apr 6, 2017

@kp77 Sorry, my previous message was an answer for @zeroc0d3. The error persists.

@thorerik
Copy link
Contributor

thorerik commented Apr 7, 2017

the hostname you should use is mysql or mariadb depending on which flavour you use.

@kp77
Copy link
Author

kp77 commented Apr 7, 2017

@thorerik I tried mysql but I got the same error.

#2005 - Unknown MySQL server host 'mysql' (-2)

@zeroc0d3
Copy link
Member

zeroc0d3 commented Apr 7, 2017

@kp77. could you send the log process?

@mauro-ni
Copy link

mauro-ni commented Apr 7, 2017

@zeroc0d3 Same feedback when using mysql as host.
#2005 - Unknown MySQL server host 'mysql' (-3)

@kp77
Copy link
Author

kp77 commented Apr 7, 2017

@zeroc0d3 Could you tell me which log process do you mean, and how I can get it?

I looked at the container logs in Kitematic, but I couldn't see any related records.

@a-h-abid
Copy link

a-h-abid commented Apr 7, 2017

@kp77 are you using the latest laradock update? If so, you need to open docker-compose.yml file go to your phpmyadmin section, then the network section and there check if both frontend and backend networks are added.

@mauro-ni
Copy link

mauro-ni commented Apr 7, 2017

@a-h-abid thank you.
It is a bug:
https://github.com/laradock/laradock/blob/master/docker-compose.yml#L392-L393

@louiskareem
Copy link

Try putting what you have in DB HOST in the server section and use password & username as root.

@neuthral
Copy link

i could login with
host: mysql
user: root
pass: root

@neutt22
Copy link

neutt22 commented Feb 1, 2018

@neuthral how come the user and password were root? it works tho! I thought it was secret as specified in the .env file of laradock.

@neuthral
Copy link

@neutt22 i have no idea, i found that out by chance, it works good after changing .env password

@andersson83
Copy link

@neuthral great one, 24 hours trying to fix de issue... ufff. Thankyou

@murilolivorato
Copy link

I cant connec as well , please , ome one can help ?

@ikingye
Copy link

ikingye commented Aug 16, 2018

change mysql from latest to 5.7
and rebuild
then login with
mysql + root + root

agebeyaw pushed a commit to agebeyaw/laradock that referenced this issue Aug 22, 2018
fix laradock#754, login to PHPMyAdmin get "laradock#2005 - Unknown MySQL server host 'mysql' (-2)" error.
@CROSP
Copy link

CROSP commented Nov 12, 2018

@neutt22 i have no idea, i found that out by chance, it works good after changing .env password

Thanks, still have the same issue, resolved by changing password in .env file, however root password remained the same root

@maxkossatz
Copy link

Had the same issue:
downgrade mysql from 8 to 5.7

by setting MYSQL_VERSION=5.7 in laradock/.env
after that in your .env file see the var called DATA_PATH_HOST and go to that folder, after that delete the mysql folder there and then do the docker-compose build --no-cache mysql and then docker-compose up -d mysql

#1855 (comment)

@m-maharjan
Copy link

Solved by changing the authentication method of user default to mysql native password.

go to mysql bash docker-compose exec mysql bash
login using root mysql -u root -p password is root.
then issue following mysql command ALTER USER 'default' IDENTIFIED WITH mysql_native_password BY 'secret';

Now in phpmyadmin login page input server as mysql user default and password secret.

@Hazelwu2
Copy link

Solved by changing the authentication method of user default to mysql native password.

go to mysql bash docker-compose exec mysql bash
login using root mysql -u root -p password is root.
then issue following mysql command ALTER USER 'default' IDENTIFIED WITH mysql_native_password BY 'secret';

Now in phpmyadmin login page input server as mysql user default and password secret.

thank you for your kind of help. It's really useful.

@ryansutrisno
Copy link

Solved by changing the authentication method of user default to mysql native password.

go to mysql bash docker-compose exec mysql bash
login using root mysql -u root -p password is root.
then issue following mysql command ALTER USER 'default' IDENTIFIED WITH mysql_native_password BY 'secret';

Now in phpmyadmin login page input server as mysql user default and password secret.

thanks for your kind of help. It's work for me. I'm used default setting on .env file just change the DOCKER_HOST_IP and version of node. Everything just default.

@beganovich
Copy link

beganovich commented Sep 1, 2019

Solved this by using mariadb instead of mysql. Next time, Oracle.

# Accepted values: mariadb - mysql
PMA_DB_ENGINE=mariadb

@sayalok
Copy link

sayalok commented Jul 25, 2021

go to mysql bash docker-compose exec mysql bash

run this to login mysql -uroot -proot

run below command to update the root user password
ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY '123';

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

Successfully merging a pull request may close this issue.