Skip navigation
Currently Being Moderated

Dreamweaver and MySql

Apr 23, 2012 10:55 AM

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?

 

Thanks,

Shawn

 
Replies
  • Currently Being Moderated
    Apr 23, 2012 11:21 AM   in reply to Sonictech

    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?

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 23, 2012 12:07 PM   in reply to Sonictech

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

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 23, 2012 12:08 PM   in reply to Sudarshan Thiagarajan

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

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 27, 2012 10:47 AM   in reply to Sonictech

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

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 27, 2012 10:52 AM   in reply to Sonictech

    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.

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 27, 2012 10:59 AM   in reply to Sudarshan Thiagarajan

    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=screen.config.15

     

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

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 27, 2012 11:48 AM   in reply to Sonictech

    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.

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 27, 2012 9:35 PM   in reply to Sonictech

    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?
     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 27, 2012 10:57 PM   in reply to Sudarshan Thiagarajan

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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2012 6:09 PM   in reply to Sonictech

    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?

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Apr 28, 2012 8:39 PM   in reply to Sonictech
    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
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2012 5:42 AM   in reply to Sonictech

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2012 6:51 AM   in reply to Sonictech

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points