4 Replies Latest reply on Aug 23, 2007 4:15 PM by (tomshen)

    Hosting company does not allow direct MySQL connection

      I am trying design a simple form with PHP and MySQL using toolbox. When using Insert a new record form wizard, I cannot connect to my hosting company's MySQL database, as direct connection is not allowed for security reasons. As a result of this, I am not able to select a database (table,user, password) to use in the wizard.

      I am stuck. I cannot alter the connection by hand, as I don't much about PHP programming.

      Please help, this is just a sample form I want.
        • 1. Re: Hosting company does not allow direct MySQL connection
          Günter Schenk Level 4
          Hi,

          >>
          ...as direct connection is not allowed for security reasons
          >>

          as in fact many hosts won´t allow this, you´d better generally develop your stuff locally using a local PHP/MySQL server, as described in the article "Setting up a PHP development environment for Dreamweaver":

          www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html

          After having defined a MySQL connection (let´s name this "conn") with DW, you´ll get a file "conn.php" generated in your site´s "Connections" folder. As your local MySQL connection data (hostname, username, password) will certainly differ from the connection data provided by your hosting company, and as you´d certainly prefer to use the same connection file both locally and remote, I personally use to...

          1. first create the connection using my local data, then...

          2. open "conn.php" with an external text editor, and in here replace the previously defined login data...

          $hostname_conn = "localhost";
          $database_conn = "database_name";
          $username_conn = "username";
          $password_conn = "password";

          ...with what´s been provided by the hosting company, then...

          3. upload the "Connections" folder including the modified "conn.php" to the remote host.

          4. in order to use this connection file on your local server, just re-enter your initially defined connection data and save this file.

          Hope this helps :-)

          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Hosting company does not allow direct MySQL connection
            Level 1
            Hi Günter,
            Thank you so much. It works! Sorry about this late reply. I got a huge project on hand. You rock:)

            Regards,
            Tom
            • 3. Re: Hosting company does not allow direct MySQL connection
              Günter Schenk Level 4
              Hi Tom,

              thanks for letting me know !

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Hosting company does not allow direct MySQL connection
                Level 1
                Hi Günter,
                Are you able to help me on this topic as well please?
                http://www.adobeforums.com/cgi-bin/webx/.3bc4f9b2

                Thanks very much,
                Tom