Copy link to clipboard
Copied
Hello,
i have recently troubleshooted a bug i have had for years. Dreamweaver by default uses mysql_pconnect when connecting to databases and this is considered bad practice for websites, Most servers only have a certain amount of connections and mysql_pconnect uses them all up and freezes all database driven websites...
You should use mysql_connect and it is very easy to change in the connection code and does not break anything...
The problem i was getting was that on 2 web servers where i have built many many websites using dreamweaver and databases I would occasionally get "too many connections error" when viewing a website, also, my own personal computer would freeze when viewing these websites because my computer had too many connections open on the same server.
So, is their anything i can change in dreamweaver to make the default mysql_connect instead on mysql_pconnect
Also, Adobe should pay me for figuring this out. ![]()
so i open the js file and it was still mysql_connect, so i guess it has to be changed elsewhere
Right. In the same folder, you should find connection_includefile.edml. Open that, and change mysql_pconnect in line 12:
$@@cname@@ = mysql_pconnect($hostname_@@cname@@, $username_@@cname@@, $password_@@cname@@) or trigger_error(mysql_error(),E_USER_ERROR);
I'm thinking this should be an update that adobe should add with new versions of dreamweaver.
File a bug report/feature request: http://www.adobe.com
...Copy link to clipboard
Copied
So, is their anything i can change in dreamweaver to make the default mysql_connect instead on mysql_pconnect
Locate the following file: C:\Program Files\Adobe\Adobe Dreamweaver CS4\configuration\Connections\PHP_MySQL\Connection_php_mysql.js. On a Mac, it should be in the same location in the Applications folder.
Line 107 looks like this:
connParams.variables["$" + connParams.cname] = "mysql_pconnect(\"" + connParams.hostname + "\",\"" + connParams.username + "\",\"" + connParams.password + "\")";
Change it to this:
connParams.variables["$" + connParams.cname] = "mysql_connect(\"" + connParams.hostname + "\",\"" + connParams.username + "\",\"" + connParams.password + "\")";
Also, Adobe should pay me for figuring this out.
But you didn't figure out how to do it, though. ![]()
Copy link to clipboard
Copied
Hello David,
i changed that file, restart my dreamweaver and then created a new connection.. it defaulted to mysql_pconnect...
so i open the js file and it was still mysql_connect, so i guess it has to be changed elsewhere
It isn't a big deal for me now that i know, in the short term, i can always open and change my connection file
I'm thinking this should be an update that adobe should add with new versions of dreamweaver. I cant tell you how many hours i wasted over the years because of this, and every time i search all the forums (adobe, apple, experts-exchange) and no one had a clue. There is just no logical reason why dreamweaver uses mysql_pconnect
Copy link to clipboard
Copied
so i open the js file and it was still mysql_connect, so i guess it has to be changed elsewhere
Right. In the same folder, you should find connection_includefile.edml. Open that, and change mysql_pconnect in line 12:
$@@cname@@ = mysql_pconnect($hostname_@@cname@@, $username_@@cname@@, $password_@@cname@@) or trigger_error(mysql_error(),E_USER_ERROR);
I'm thinking this should be an update that adobe should add with new versions of dreamweaver.
File a bug report/feature request: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform.
Copy link to clipboard
Copied
thank you
Copy link to clipboard
Copied
Hi,
I also have this problem now.
My hosts have pconnect disabled as a security measure so I changed the configuration files as avised above to use mysql_connect instead but when I try and test the connection in dreamweaver I still get this error:
---------------------------
Dreamweaver
---------------------------
Your PHP server doesn't have the MySQL module loaded or you can't use the mysql_(p)connect functions.
---------------------------
OK
---------------------------
Copy link to clipboard
Copied
The problem has nothing to do with Dreamweaver. As the error message says: "Your PHP server doesn't have the MySQL module loaded".
Run phpinfo(), and check whether mysql is listed. If you're getting that message, it almost certainly means MySQL is not enabled in your PHP configuration. MySQL is not enabled by default in PHP.
Copy link to clipboard
Copied
As I explained earlier the problem is that my hosts have mysql_(p)connect disabled for security reasons.
mysql is running just fine and I have databases running which I connect to remotely with no problems.
The problem is that dreamweaver uses pconnect to establish its connections and my hosts no not allow this type of connection.
You can see my phpinfo() at http://teeandtoast.com/test.php and although this says that persistent connection are allowed, I have been assured my my hosts that they have been disabled and that is what is causing the problem.
What I need is an alternative way of connecting dreamweaver to my database - preferably using mysql_connect and not using a persistent connection.
Copy link to clipboard
Copied
The simple way is to open the file in your Connections folder, and change mysql_pconnect to mysql_connect. Save the file and upload it to your remote site.
If you want to change the way that Dreamweaver creates the connection file in the first place, follow the instructions I gave to the original poster.
Copy link to clipboard
Copied
David_Powers wrote:
The simple way is to open the file in your Connections folder, and change mysql_pconnect to mysql_connect. Save the file and upload it to your remote site.
That is not the issue I am asking about.
David_Powers wrote:
If you want to change the way that Dreamweaver creates the connection file in the first place, follow the instructions I gave to the original poster.
As I mentioned in my original post, I tried modifying the files exactly as you said, but it did not work. I still get the pconnect error.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now