I am trying to run java web app. Thus, I must setup MySQL, phpmyadmin and Apache Tomcat for accessing website. I want to use the docker and its docker-compose
application to make installation easier (If I may learn).
I could not set mysql
and phpmyadmin
applications to work together. If I can get past this first step, I will try to install tomcat
.
This is my codes which is used(docker-compose.yml
)
version: '2'
services:
db:
image: mysql
restart: always
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: myDb
MYSQL_USER: admin
MYSQL_PASSWORD: 12345
MYSQL_ROOT_PASSWORD: root
phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
ports:
- "8080:80"
environment:
MYSQL_USER: admin
MYSQL_PASSWORD: 12345
MYSQL_ROOT_PASSWORD: root
depends_on:
- db
links:
- db
I open the above codes with docker-compose up
in the command line application.
I’m going to http://localhost:8080/
page, I’m typing admin
for Username, 12345
for password.
The errors I get are:
Cannot log in to MySQL server
mysqli_real_connect (): The server requested authentication method
mysqli_real_connect (): (HY000 / 2054): The server requested authentication method
How can I install the applications (mysql
, phpmyadmin
, tomcat
) with docker-compose
?
2
Answers
Currently phpmyadmin and MySQL can work together. It is solved.
PLAN A: This is my
docker-compose.yml
file:Now, you can go into
MySQL
viaphpmyadmin
athttp://localhost:8080
It can also be solved by this method.
PLAN B: This is my
docker-compose.yml
file:Command line's commands:
Now, you can go into
MySQL
viaphpmyadmin
athttp://localhost:8080
Reference: phpMyAdmin on MySQL 8.0