20 Replies Latest reply on Apr 29, 2012 6:51 AM by Ben M

    Dreamweaver and MySql

    Sonictech Level 1

      I am trying to connect to an external sql database, the issue is that dreamweaver is adding th @domain name to the username for the MySql.  Is there a way for it NOT to put this is automatically and only use the username that I type in to that username space?




        • 1. Re: Dreamweaver and MySql
          Lon Winters Level 4

          That's a new one - I've never heard of DW doing that in either the database connection script or even in the site definition.,have you tried editing the connection string directly in the page in the connections folder?

          • 2. Re: Dreamweaver and MySql
            Sonictech Level 1

            Not sure on what you are talking about.  I have a Joomla site up and running and I am trying to set the database in dreamweaver to pull the files from the external MySql server.  I click the "+" to add the Database and put all the correct information but when it try's it adds the username@domainname.com for the user.  Is there a way to stop that from doing this, I think it would connect if it did.




            • 3. Re: Dreamweaver and MySql
              sudarshan.t Level 6

              It's simple: Once Dreamweaver adds the @domainname (I doubt it does, but even if it does!), remove the @domainname from your code.

              • 4. Re: Dreamweaver and MySql
                sudarshan.t Level 6

                Or, post your code here. We'll check.

                • 5. Re: Dreamweaver and MySql
                  Sonictech Level 1

                  I have attached two images below showing the settings and the errors:


                  error 1.jpg


                  Below is the image showing the @domain.com error


                  error 2.jpg


                  Thanks for all the help trying to resolve this.



                  • 6. Re: Dreamweaver and MySql
                    Sonictech Level 1

                    Has anyone been able to connect to an external MySql with dreamweaver?  Need help with this please.




                    • 7. Re: Dreamweaver and MySql
                      sudarshan.t Level 6

                      You're saying you're trying to connect to a remote server. But why does your config show $host as localhost?

                      • 8. Re: Dreamweaver and MySql
                        sudarshan.t Level 6

                        Also, depending on what host you're with, you may have to add your IP to Remote MySQL Access List to be able to let your MySQL Server authenticate your request. This is not the case for all hosts. Some hosts like Hostgator do this for security reasons.

                        • 9. Re: Dreamweaver and MySql
                          sudarshan.t Level 6

                          Also, maybe this link should help you since you mentioned you're working on Joomla!


                          http://help.joomla.org/index.php?option=com_content&task=findkey&tmpl=component;1&keyref=s creen.config.15


                          At the bottom you'd see the Server parameter tab. Have you tried inserting your Remote server/ User/ PWD for MySQL here?

                          • 10. Re: Dreamweaver and MySql
                            Sonictech Level 1



                            The reson you are seeing the "Localhost" is because that is the configuration.php off that server, not off my laptop at home.  I have also set up the IP address to allow remote MySql to be acess.  I appreciate all the info and your help with this, this is just one of many Joomla sites that would be nice if I can get set up using dreamweaver and loading everything from the database so when I do changes they are done and I can see how it looks withthe layout.




                            • 11. Re: Dreamweaver and MySql
                              sudarshan.t Level 6

                              The reson you are seeing the "Localhost" is because that is the configuration.php off that server, not off my laptop at home.  I have also set up the IP address to allow remote MySql to be acess

                              Even in this case, when you say localhost appears because its the configuration.php off the server that you have Joomla installed in, that value should be changed to the IP/ domain of the remote server from where your SQL server is running. This is the only way Joomla will connect to your remote server to access the DB.


                              I'd recommend that instead of touching the configuration.php you go into Joomla's UI with the help of the link I gave you in my previous post to update the settings. This way Joomla will take care of changing the settings for you in configuration.php.


                              Once this is done, you could get the configuration.php file on your local system to do other changes.

                              • 12. Re: Dreamweaver and MySql
                                Sonictech Level 1

                                Doesnt work, about to give up on it.


                                Thanks for your help but dreamweaver does nto connect to an external host and it's database.




                                • 13. Re: Dreamweaver and MySql
                                  sudarshan.t Level 6

                                  Giving up is not going to solve this, Shawn! While I understand your frustration, I'm sure there's a workaround. All you need is some troubleshooting to be done. Dreamweaver definitely does connect to external hosts very well. So, it's not DW that's not letting you connect. There's something else wrong - maybe somewhere in your DB connection strings or in the interface php file between your Joomla config and your external DB config.


                                  Let us know your answers to these points & we'll see how we can get there:

                                  1. You posted a screenshot of a new MySQL Connection - are you trying to do this from within the Joomla's configuration.php page? Have you defined this as a site in DW?
                                  2. Do you have an external connection.php or db.php to connect to your DB or are you solely using Joomla's configuration.php to connect?
                                  3. Did you try Joomla's UI for making the change like I suggested yesterday? If you did, what was the outcome?
                                  • 14. Re: Dreamweaver and MySql
                                    sudarshan.t Level 6

                                    Also, recently found this link. It may help you: http://docs.joomla.org/Connecting_to_an_external_database

                                    • 15. Re: Dreamweaver and MySql
                                      Sonictech Level 1

                                      Ok, maybe I am not explaining this properly or I am miss understanding this.  Let's try this all over...


                                      Host (Ace-Host, Go-Daddy, etc....)  This is where I have joomla installed and running, when joomla is loaded it made the database on their server.  The site is up and running with the content loaded.  I am working on the "Template" for the Joomla site, I am using Dreamweaver CS5.5 to do the changes I need to the CSS and the PHP scripts on the site, this part is working great. Everytime I do a change and upload it using Dreamweaver I have to open a web browser (Firefox, IE9, Chrome, Safari) to look at the changes that I have made, this is where I would like to be able to connect to the database from my laptop so I can see how the data looks in "Live View" in Dreamweaver,


                                      This is what I am wondering, do I need to run WAMP on my laptop and run the joomla site on my personal laptop in order to see the changes and then some how set up Dreamweaver to pull from the database on the host site, is this what I am doing wrong?




                                      • 16. Re: Dreamweaver and MySql
                                        Ben M Adobe Community Professional

                                        Sorry to jump in so late Sonic, but can you download the mySQL workbench ( http://wb.mysql.com ) and confirm that you are able to establish a remote connection with that?  Also how have you defined your testing server in DW?

                                        • 17. Re: Dreamweaver and MySql
                                          Sonictech Level 1



                                          Thanks for jumping in!  I have loadsql workbench and tested to see if it connect, it said "Connection parameters are correct" so it looks like I am good on that.  I have attached a image of the settings I have for the testing server.


                                          Thanks again,




                                          • 18. Re: Dreamweaver and MySql
                                            sudarshan.t Level 6
                                            1. You should already be running WAMP/ LAMP/ MAMP to be able to view PHP files locally on your computer
                                            2. Regarding the database, you need to have a database dump loaded to phpMySQL on your local system if you want to load the database off your localhost for testing purposes
                                            3. There is no point in creating a remote testing server as you clearly mentioned that you want to be able to test your site in Live View without having to upload your files on your remote server everytime. In this case, Your testing server should be your WAMP/ LAMP/ MAMP localhost on your laptop and you have 2 options for the DB
                                              1. Have your localhost as your PHP testing server but connect to your DB remotely using 'MySQL Connections'
                                              2. Have your localhost as your PHP testing server and also create a local DB with all the remote DB's SQL dump data to simulate everything on your local system itself
                                            • 19. Re: Dreamweaver and MySql
                                              codeDawg Level 2

                                              Shawn - what a cool idea!  Never tried that before.


                                              I would tackle this problem in two phases.


                                              First, install a local Joomla framework on the laptop and configure it to pull the live site content (external database) as per Sudarshan's suggestions and links.

                                              This can be tested by pointing your browser to the local (laptop) installation and seeing if the live site content shows up.

                                              (You will need to run a WAMP stack locally since you are running Joomla locally.)

                                              If everything is running as expected, you should be able to make local template changes and view results (with live content) without uploading the template changes to the live site.

                                              (You would have to hit refresh on your browser, which is pointed to the local Joomla installation.)


                                              There's about a million ways this can go wrong, depending on how Joomla builds it's links.  But the settings in the article pointed to by Sudarshan's link suggests this can be done.


                                              Only after I got that part to work would I then try to integrate DWs LiveView.

                                              I'm stuck in the dark ages with DW CS3 so I've never had a chance to work with LiveView.

                                              Just an observation from your original post, "that dreamweaver is adding the '@domain' name to the username for the MySql", sure seems like a 'misplaced' DW config setting somewhere.

                                              • 20. Re: Dreamweaver and MySql
                                                Ben M Adobe Community Professional

                                                The problem is with your setup.  Now that I have seen your site definition I can diagnose the problem and give a bit of an explanation of DW's expectactions.


                                                First I have to criticize the use of FTP.  By sending your data over FTP, you basically send your username and password in plain text all the time.  It's not DW's fault, but rather the fault of the protocol.  I'd suggest having a long discussion with your web host about using SFTP, which utilizes SSH, or FTPS which uses SSL to encrypt your connection.


                                                With that said, that leads to our first problem the Web URL.  Now when setting up DW, I will admit it is a fault of DW that it adds the Root URL to the Domain.  However, you will want to remove the "/public_html" from the end of the Web URL address.  The Root URL simply says when you connect to FTP, connect to this folder.  The Web URL is what the browser sees and while the browser is looking in the public_html folder, it is transparent because it is something processed by the server.  So only your domain or IP is needed.  You do not have to use your IP here but can if you choose to do so.


                                                Next, since you have confirmed a successful connection with the Workbench, I will assume your IP is correct on the server for the remote access and has not been changed by your ISP.


                                                Now is the tricky part and goes back to your original post about why DW adds your domain to the address.  The way DW connects to your database is not the same as the Workbench.  What DW actually does is connects you to the server as if you are on the server, thus the address in your SQL Connection window will actually be the same as how you configure your Joomla script, that being "localhost".  From what I have read from Acehost, I am not under the impression that your mySQL database is on a separate server from your web server.  It's the old conundrum of what happens when you dial your own phone number.  The answer is you get a busy signal.


                                                So if you make the change to the Web URL, and then change the mySQL address to "localhost", from everything I see you should be able to make a good connection to the server.  You should leave your Joomla configuration file as "localhost" as you are now testing with the live server.


                                                Now just to add one more comment on this.  Typically DW is setup so that your testing server is not your live server so that you can make these changes without having to upload everything to your live server.  So as a best practice it is typically recommended to bring a copy of your database down to a local MAMP/WAMP server and then push the changes to the Remote Server once you have completed your changes.  Also to prevent always overwriting your files in this scenario you may want to go to the DW preferences -> Preview in Browser -> and enable Preview Using Temporary Files otherwise when you go to preview if you made any changes to your core files DW will save, upload and overwrite automatically for testing.


                                                If you run into any problems implementing this please post back.