18 Replies Latest reply on Dec 28, 2014 9:06 AM by SemaphoreComp

    Can't connect to MySQL [subject edited by moderator]

    SemaphoreComp

      Unable to connect to a remote MySQL database with FTP from 'MySQL Connections' despite all connection parameters being valid, just get "an unidentified error has occured" message.connections v2.jpg

        • 1. Re: Can't connect to MySQL [subject edited by moderator]
          MurraySummers Level 8

          Connecting to the MySQL database has nothing to do with your FTP. Given the screens that you show for the database operations I'd say to contact your host. Everything you have supplied looks right to me.

          • 2. Re: Can't connect to MySQL [subject edited by moderator]
            SemaphoreComp Level 1

            Thanks for the very swift reply, I connected the hosting company first and they checked out the details (as in the screenshots) and were able to connect and said 'try Adobe support' !

            • 3. Re: Can't connect to MySQL [subject edited by moderator]
              MurraySummers Level 8

              If you are a trusting soul, you can PM me with the MySQL connection details, an I will try to connect from my computer. That will tell me if there might be something wrong in the way you have entered things.

              • 4. Re: Can't connect to MySQL [subject edited by moderator]
                SemaphoreComp Level 1

                Hi, yes, that would be very helpful, thanks. There's nothing sensitive about the database or the data, it was just a proof of concept for a user name / password validation. (So far the concept is far from proven !).

                I think you can see all the pertinent details in the screenshot except the p/w ?

                • 5. Re: Can't connect to MySQL [subject edited by moderator]
                  MurraySummers Level 8

                  Can you give me the full name of your mysql server, please? It's truncated in the image you posted.

                  • 6. Re: Can't connect to MySQL [subject edited by moderator]
                    MurraySummers Level 8

                    Wait - that's the name of your FTP host, but is it also the name of your mysql server? Have you asked your host what name you should use for the mysql server?

                    • 7. Re: Can't connect to MySQL [subject edited by moderator]
                      SemaphoreComp Level 1

                      Hi again,

                      I have, from the hosting company's datasheet :

                      Database host MySQL:localhost, - external: e23921-mysql.services.easyname.eu

                      FTP host : e23921-ftp.services.easyname.eu

                      hope this helps !

                      • 8. Re: Can't connect to MySQL [subject edited by moderator]
                        MurraySummers Level 8

                        Ask your host if they allow foreign database connections, please. By "foreign" I mean from your local computer to the mysql server. If they do not, then the only way you'll be able to connect to their mysql server is by uploading the file to the host site, and connecting to the server as "localhost". Do you have a control panel for this hosting site? Many control panels will allow you to specify your own IP address as an allowed 'foreign' entity, and your connection attempts will then be allowed through the firewall.

                        • 9. Re: Can't connect to MySQL [subject edited by moderator]
                          SemaphoreComp Level 1

                          Hi again,

                          I've looked through the control panel options and the those relating to the databases seem pretty limited and don't seem to cover specifying IP addresses. When I initially contacted easyname's tech support they said they could connect to the database and to try Dreamweaver support.

                          For your alternative suggestion, do you mean exporting the database using phpMyadmin and then FTP-ing it to the same directory as the website ? Doesn't this slightly sidestep any security around the whole idea of what I was trying to achieve of creating a table of users and passwords, since anyone will be able to see it ?

                          thanks !

                          • 10. Re: Can't connect to MySQL [subject edited by moderator]
                            Rob Hecker2 Adobe Community Professional & MVP

                            Doesn't this slightly sidestep any security around the whole idea of what I was trying to achieve of creating a table of users and passwords, since anyone will be able to see it ?

                             

                            No, what Murry is describing is a process where you export the database from phpMySql on your local machine, then import it to the server using import in phpMySQL. . . .or vice versa. You can go the other direction using the same method.

                             

                            But if easyname told you they were able to connect to the database, they meant remotely? and did they share with you the configuration they used?

                            • 11. Re: Can't connect to MySQL [subject edited by moderator]
                              MurraySummers Level 8

                              Actually, I was describing what you need to do to connect to the database with DW. If your attempt to connect is blocked by the firewall (because you are a foreign entity), you will never be able to test the connection parameters in DW. Failing that then you will have to do exactly what Rob is suggesting:

                               

                              1. Connect to the database via the host's phpMyAdmin

                              2. Export the database's contents to a sql dump file

                              3. Import that dump file into a local mysql database

                              4. Configure DW to connect to the local database

                              5. Build your connection script in DW

                              6. When completed, export locally and import remotely (the reverse of #2 and 3)

                              7. Upload your script and adjust your connection parameters to use "localhost" for the mysql server name

                               

                              It's a tedious and complex series of steps for sure. My preference is to always get an exception added to the host's firewall for my IP address - then I can connect, build and develop directly on the mysql server for the site. (and by the way, I much prefer using Navicat to using phpMyAdmin!)

                              • 12. Re: Can't connect to MySQL [subject edited by moderator]
                                Rob Hecker2 Adobe Community Professional & MVP

                                I have not tried Navicat. I use MySQL workbench.

                                 

                                I actually do use the SQL dump method sometimes when I need to have various "states" of the database or just want to make sure I can fallback to a particular state.

                                 

                                As for making an exception for the ip address on the server, I have that ability in WHM but not cPanel, so my guess is that the OP would need to make a request from easyname. Also, a static IP address is required. Not everyone has one.

                                • 13. Re: Can't connect to MySQL [subject edited by moderator]
                                  osgood_ Level 8

                                  MurraySummers wrote:

                                   

                                  Actually, I was describing what you need to do to connect to the database with DW. If your attempt to connect is blocked by the firewall (because you are a foreign entity), you will never be able to test the connection parameters in DW. Failing that then you will have to do exactly what Rob is suggesting:

                                   

                                  1. Connect to the database via the host's phpMyAdmin

                                  2. Export the database's contents to a sql dump file

                                  3. Import that dump file into a local mysql database

                                  4. Configure DW to connect to the local database

                                  5. Build your connection script in DW

                                  6. When completed, export locally and import remotely (the reverse of #2 and 3)

                                  7. Upload your script and adjust your connection parameters to use "localhost" for the mysql server name

                                   

                                  It's a tedious and complex series of steps for sure. My preference is to always get an exception added to the host's firewall for my IP address - then I can connect, build and develop directly on the mysql server for the site. (and by the way, I much prefer using Navicat to using phpMyAdmin!)

                                   

                                  What happens if the remote host loses the database file/s?

                                   

                                  I recently had an instance where a certain well known provider in the UK managed somehow to lose all my website files and database files. I was only able to restore the site because I had a local duplicate copy of the site files and database files. I know it don't happen that much but its possible. You must ALWAYS keep an up-to-date version of the wesbite files locally - personally I never connect locally to a remote database because unless you have some 'automated' back-up either on your own local server or the host server this could spell trouble.

                                   

                                  If a client updates their own site I pass the resposibility of backing up the database over to them, as far as I know none do, prefering to leave the responsibility to the host, great if they do - not so good if they don't or lose the files.

                                   

                                  EDITED,

                                   

                                  I think Navicat takes care of the automated database back-up, right? - I dunno about phpMyAdmin though.

                                  • 14. Re: Can't connect to MySQL [subject edited by moderator]
                                    SemaphoreComp Level 1

                                    thanks for this. I think I'll get back to Easyname with your comments and suggestions since the problem seems to lie at their end and all the work arounds seem horendous.

                                    One question though, if they add my IP address to their host's firewall, what about everyone else who actually wants to use my site as intended and have their logon credentials validated. They won't be able to connect to the database either ?

                                    • 15. Re: Can't connect to MySQL [subject edited by moderator]
                                      Rob Hecker2 Adobe Community Professional & MVP

                                      They won't be able to connect to the database either ?

                                       

                                      No. Having your IP added gives you the ability to connect to and manage the database directly. Website visitors don't have or need this ability. They connect through your web application.

                                      • 16. Re: Can't connect to MySQL [subject edited by moderator]
                                        osgood_ Level 8

                                        SemaphoreComp wrote:

                                         

                                         

                                        One question though, if they add my IP address to their host's firewall, what about everyone else who actually wants to use my site as intended and have their logon credentials validated. They won't be able to connect to the database either ?

                                        I think if this happens AND you are the administrator  then the security settings on the server are too severe. I don't know how it works but I think the security detects some kind of pattern and blocks your ip. I experienced this on only one server - after they added my ip address to their system then all was well BUT it may happen a few times. If your IP is being blocked by the server without you asking it to be blocked I'd get the security setting lowered a notch or two becuase as you say you don't really know who else is being blocked that may be you don't want blocked.

                                        • 17. Re: Can't connect to MySQL [subject edited by moderator]
                                          MurraySummers Level 8

                                          Hosts will often block any access to their mysqlservers other than localhost. I don't believe it's a case of blocking a specific IP - it's really just blocking EVERYBODY. The only way you can get through this is to either create (via the control panel) or ask to be created an exception for your specific IP. This really works fine, except that your IP address CAN change over time (although mine has not for more than 2 years), since it's dynamically assigned by the ISP's DHCP process.

                                          • 18. Re: Can't connect to MySQL [subject edited by moderator]
                                            SemaphoreComp Level 1

                                            thanks for all your help and suggestions on this one.

                                            I'm going to send Easyname a link to this dialogue and ask them for their thoughts. I shouldn't have to re-invent the wheel here, they must have a recommeded course of action !

                                            thanks for now, will post their reply . . . .