

I have no idea what i have to do, I'm overly frustrated, and if you ask, I basically put random lines from the internet to make my bash script and my dockerfile. " Cannot log in to the MySQL server", " mysqli_real_connect(): (HY000/2002): Permission denied", " Connection for controluser as defined in your configuration failed.", " mysqli_real_connect(): (HY000/2002): Permission denied"
#Link phpmyadmin docker instance to mysql update
First, log in to your Ubuntu server and update it with the latest packages: sudo apt update. docker run -d -p 8082:80 \ -e PMAHOSTmysqldb \ -name phpmyadmin \ -net. Now we start the instance, naming it test-phpmyadmin and link it to the database mysql test-mysql that we have created before.
#Link phpmyadmin docker instance to mysql install
In this step, you will install the phpMyAdmin package and the web server necessary to access your MySQL Managed Database. And the phpMyAdmin container has to run in the same network( mysql-network) in order to connect with the MySQL container. I can access apache2 through localhost:80 and I'm pretty sure mysql is up because my queries worked.īut logging in to localhost/phpmyadmin with "admin:admin" just won't work: Step 1 Installing phpMyAdmin and Configuring Apache. I run my container through docker build -t whatever. Mysql -u root -password= -e "CREATE DATABASE PROJECT_MANAGEMENT "Īnd this is the content of my start.sh: #!/bin/bash Mysql -u root -password= -e "GRANT ALL PRIVILEGES ON *.* TO -u root -password= -e "FLUSH PRIVILEGES " Mysql -u root -password= -e "CREATE USER IDENTIFIED BY 'admin' " Mysql -u root -password= < /usr/share/phpmyadmin/sql/create_tables.sql # I'm creating the phpmyadmin database here This is the content of my init.sh: #!/bin/bash

RUN cp /etc/phpmyadmin/nf /etc/apache2/conf-available/nf config-db.php /etc/phpmyadmin/config-db.php # I've set the dbuser to 'admin' dbpass to 'admin' hereĬOPY. RUN DEBIAN_FRONTEND=noninteractive apt -y install apache2 php libapache2-mod-php mysql-server php-mysql phpmyadmin It supports several ways of configuring the link to the database server, either by Dockers link feature by linking your database container to db for phpMyAdmin. This is the content of my dockerfile: FROM ubuntu:20.04 Follow these steps: In the Connection -> SSH -> Tunnels section, add a new forwarded port by introducing the following values: Source port: 8888. I'm trying to have one docker container with: ubuntu 20.04, on top of which I add apache, php, mysql and phpmyadmin (all on the same container) Once you have your SSH client correctly configured and you have confirmed that you can successfully access your instance using SSH, you need to create an SSH tunnel in order to access phpMyAdmin.
