Timeline for PHP 7.2.8 PDO Fails to Connect to MySQL 8.0.12 (GA) in AWS EC2 LEMP Stack
Current License: CC BY-SA 4.0
26 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 4, 2018 at 9:00 | vote | accept | HumanJHawkins | ||
| S Aug 4, 2018 at 8:33 | history | suggested | HumanJHawkins | CC BY-SA 4.0 | Moved paragraph with correct answer to the top, and less relevant info down. |
| Aug 3, 2018 at 22:11 | review | Suggested edits | |||
| S Aug 4, 2018 at 8:33 | |||||
| Aug 3, 2018 at 13:00 | history | edited | Gerard H. Pille | CC BY-SA 4.0 | added 346 characters in body |
| Aug 2, 2018 at 22:39 | comment | added | Gerard H. Pille | That is great, I'm really curious what is going on. Send me a pm, use one of my addresses, ghpille at hotmail or gmail dotcom. But I'll have some sleep first. | |
| Aug 2, 2018 at 20:31 | comment | added | HumanJHawkins | I am happy to give you root access if you are interested in poking around. If/when a solution is found, I plan to wipe it out and rebuild to confirm and document the process of getting this working. There is nothing confidential on the server, etc. I don't see a way to send private messages on StackExchange. I have a nearly obsolete email you could contact me on if you like... [email protected]. I don't want to post my regular email publicly, due to the spam that invites. | |
| Aug 2, 2018 at 20:14 | comment | added | HumanJHawkins | Regarding RDS, this build is not using it. RDS is an alternate (seperate server) way of hosting a DB. This system is just using an EC2 instance, which is simply a virtual server. There really isn't anything at Amazon to get in the way of it, except for their firewall. And other successful connections from outside the firewall corroborate the idea that it is not the problem. | |
| Aug 2, 2018 at 18:11 | comment | added | Gerard H. Pille | Do you know the "RDS management console"? "You do need to set the VPC security group to ensure that you can access the database", says dummies.com/programming/cloud-computing/amazon-web-services/… | |
| Aug 2, 2018 at 7:40 | comment | added | Gerard H. Pille | I thought to open a "free tier account" on AWS, but they want my credit card data. I'm not willing to hand that to mr. Beezos, he's rich enough as it is. | |
| Aug 2, 2018 at 3:08 | comment | added | HumanJHawkins | Sorry... I can ping localhost and do have loopback. Adding ifconfig info to the question. Also putting a link to the exact setup steps used for this server in latest addendum. | |
| Aug 1, 2018 at 23:02 | comment | added | Gerard H. Pille | I'll try and configure an aws comparable to yours, and get back to you with the results. That'll be during the day, it's 1 am here. Still wondering if you have loopback connector. | |
| Aug 1, 2018 at 22:14 | comment | added | HumanJHawkins | At this point, I'll be happy to redeploy a server to continue testing if significant new info is found... I want to understand this. But toward having a working system I am going to shelf this and roll to earlier known-good technology. | |
| Aug 1, 2018 at 22:12 | comment | added | HumanJHawkins | Tried rout -v add and the private IP with no luck. I'm confident this is not an AWS config issue, as AWS is external to the server and the same systems that would potentially cause problems, do not interfere with other (Datagrip, etc) connections. Regarding configuring the server for public only, I dropped all testuser logins and remade them for 'localhost', 127.0.0.1, 172.31.37.0, 34.208.22.26, and codehawkins.com. Then tested both local (localhost) and remote via FQDN. | |
| Aug 1, 2018 at 9:40 | comment | added | Gerard H. Pille | I wonder if this shouldn't be handled through the AWS Management Console. Perhaps you configured your DB as being publicly accessible only. | |
| Aug 1, 2018 at 9:29 | comment | added | Gerard H. Pille | "route -v add -net 172.31.37.0 netmask 255.255.255.0 dev eth0" and use 172.31.37.13 as host for PDO. When you run "ifconfig", do you see the loopback connector? Can you ping localhost? | |
| Aug 1, 2018 at 9:06 | comment | added | HumanJHawkins | Editing the question to clarify environment. Not Docker, but it is AWS EC2 (a virtual server). | |
| Aug 1, 2018 at 8:50 | comment | added | Gerard H. Pille | according to your phpinfo, server address is 172.31.37.13, which your route config does not allow to reach. Your MySQL is not running in a docker or something? | |
| Aug 1, 2018 at 8:43 | comment | added | Gerard H. Pille | So, everything goes to 172.31.32.1 ?? What does "ifconfig eth0" show? | |
| Aug 1, 2018 at 8:22 | comment | added | Gerard H. Pille | Can you add "netstat -rn" output to your question. I'm looking for something (eg. a firewall) that prevents a client on the AWS to connect to the server on the same system. | |
| Aug 1, 2018 at 8:16 | comment | added | HumanJHawkins | Right... But the IPv4 lines are all 3306. Was wondering about that, but did not pursue since I am trying to connect with IPv4. | |
| Aug 1, 2018 at 8:15 | comment | added | Gerard H. Pille | "IPv6 26492 0t0 TCP *:33060 (LISTEN)" is not 3306! | |
| Aug 1, 2018 at 8:14 | comment | added | HumanJHawkins | So, I just checked again... I could before and can still connect with no problem using the IPv4 address (or FQDN) from a remote workstation using the domain name or IP address. Wondering how that is possible if it was not listening on IPv4 3306 (though lsof said not?). This is a single server running the full LEMP stack... Would it be something to do with having PHP and MySQL on the same machine? (Many thanks for your thoughts!) | |
| Aug 1, 2018 at 8:04 | comment | added | HumanJHawkins | Oddly, "bind-address = 0.0.0.0" is supposed to mean IPv4 and only IPv4. However, I still see many rows similar to "IPv6 26492 0t0 TCP *:33060 (LISTEN)" Also, this was a complete default install... Very odd that it would not be listening on IPv4 3306 from the start. I used mysql --help to identify all the .cnf files, and none of them had a bind-address line until I added it. | |
| Aug 1, 2018 at 8:00 | comment | added | HumanJHawkins | This looked like the answer... I've set bind-address = 0.0.0.0 (any IPv4) just to test. I'm guessing it solved part of the problem, but it still refuses to connect. If I do "lsof -Pn | grep LISTEN | grep mysqld | grep", I now get many lines with IPv4 such as: "mysqld 1796 1807 mysql 20u IPv4 29908 0t0 TCP *:3306 (LISTEN)" | |
| Aug 1, 2018 at 7:39 | history | edited | Gerard H. Pille | CC BY-SA 4.0 | added 176 characters in body |
| Aug 1, 2018 at 7:07 | history | answered | Gerard H. Pille | CC BY-SA 4.0 |