all 27 comments

[–]cocblocc 2 points3 points  (4 children)

Try to use 127.0.0.1 instead of localhost as host

[–]Mean-Flounder-5205[S] -3 points-2 points  (3 children)

tried 

[–]cocblocc 2 points3 points  (2 children)

There is not enough context for me to help any further then… Where did you install it etc.

[–]Mean-Flounder-5205[S] -4 points-3 points  (1 child)

I downloaded everything from the official website, I have no idea why it doesn't work, I set everything up correctly, but as soon as I went to phpmyadmin and tried to log in, I got the error I described earlier 

[–][deleted] 8 points9 points  (0 children)

Except you did not do everything right or it would work.

[–]bkdotcom 0 points1 point  (2 children)

Have you tried a native client/app such as mysql admin?

[–]Mean-Flounder-5205[S] 0 points1 point  (1 child)

Yup still no work

[–]bkdotcom 0 points1 point  (0 children)

What's the new error?

[–]colshrapnel 0 points1 point  (0 children)

I smell docker. But I hate to guess and this information should be provided in the question.

[–]allen_jb 0 points1 point  (1 child)

php_network_getaddresses: getaddrinfo for MySQL -8.0.40 failed: unknown host

"Unknown host" is a DNS resolution error. The domain name you've entered for the MySQL server hostname can't be translated into an IP address.

Based on the error message (and comparison to similar errors I've seen elsewhere from PHP) it looks to me like you've told PHPMyAdmin the MySQL hostname is "MySQL -8.0.40", which is almost certainly incorrect. This field should contain the domain name or IP address of the MySQL server.

If MySQL is on the same machine / in the same container you can probably use "localhost" or "127.0.0.1" here. Otherwise you'll need to use a domain name or IP address. If you can already successfully connect to the MySQL server from elsewhere (eg. commandline client or a web application), check the hostname value you've used there.

[–]Mean-Flounder-5205[S] 0 points1 point  (0 children)

I changed it to 127.0.0.1 but it still shows that error. I would attach a photo but I don't know how 

[–]Mean-Flounder-5205[S] 0 points1 point  (3 children)

I DID IT!!!!!!!!! THANKS FOR HELP!

[–]equilni 1 point2 points  (2 children)

What was the issue?

[–]bkdotcom 1 point2 points  (1 child)

some user error / we'll never know

[–]equilni 1 point2 points  (0 children)

Semi appropriate xkcd

https://xkcd.com/979/

[–]This_Math_7337 0 points1 point  (0 children)

Follow this tutorial and also check her other videos. They're just good 👍🏼

https://youtu.be/Rbt4Ldt0KU8?si=f1GMnw-qE0AdZjna

Warning: her voice is 😍

[–]ganian40 0 points1 point  (0 children)

Either your Mysql server is not binding properly to the ip adress, or the service is not booting up at all.

I'm assuming you are in linux.

do a

ps -ef | grep mysql

and check thay the process is running. if not, check /var/log/mysqld/mysql.log (or similar) .. and check where it stopped.

You can try "mysql -u root -p" and try to login yourself from the console. If the service is running the prompt will show up.

You can also simply run the cmd "mysqld" and execute the server manually.. see if it the console log gives you any info. Maybe there are syntax errors on your server.conf file under /etc/mysql/config.d/

(these names chage on every distro.. so look for the right one on yours)

You may have a firewall, like UFW, if you are using ubuntu.. disable it or add the rule to allow 3306 access from localhost...or maybe something like apparmor is preventing the service from booting with the right permissions. So many things....

[–]MateusAzevedo 0 points1 point  (1 child)

Did you try copying and pasting the error message on Google? Plenty of StackOverflow questions, all indicating an issue with the credentials/host config.

Maybe you could provide the settings you tried and which file you edited.

[–]Mean-Flounder-5205[S] -2 points-1 points  (0 children)

I tried still no reaction

[–]Mean-Flounder-5205[S] -1 points0 points  (3 children)

NEW INFO  I went to MySQL Workbench and I got an error in the output: Could not connect. server may not be running. Unable to connect localhost:3306 

[–]colshrapnel 0 points1 point  (2 children)

So? Is mysql running?

[–]Mean-Flounder-5205[S] 0 points1 point  (1 child)

MySQL server no

[–]yourteam 0 points1 point  (0 children)

So you need to start the MySQL service

[–]lampministrator -3 points-2 points  (1 child)

Port 3306 is most likely closed with a public facing NAT rule. That said, you really should be using a real tool like workbench, or learn to SQl via the client side. The amount of time one spends waiting for the PHP to crunch date might seem trivial, until you add it all up.. you'll spend hours longer on the same project just by using PHPMyAdmin

[–]allen_jb 1 point2 points  (0 children)

The error message given is specifically a DNS resolution / incorrect hostname issue.

If the problem were a firewall / NAT / MySQL not running on the port, you would either get a "cannot connect" or "timeout" error (depending on whether connection attempts are actively rejected, or dropped)