PHAkt Connections for Dummies

The main tutorials for setting up your PHAkt connection are great. But since I knew so little, I found I needed specific guidance about what to put in each field. The exact syntax was messing me up, and I missed some comments in the install notes. This is what I wish I knew when I started.

PHAkt Connections for Dummies

I am not going to duplicate any of the very excellent tutorial information already written about getting a database connection. What I am going to do is put up a quick list of places I stumbled while getting it to work, so that maybe it will help some others here and free up the resident gurus to more important tasks like writing new extensions for us. I am NOT an expert, and probably cannot even answer questions. Everything I know is in this tutorial. :)

Assumptions:

I am going to give you MY specific set of circumstances, since that is all I know.

  • I was a first time install of PKAkt with version 1.0.
  • Running on a shared host, with correct versions of PHP and MySQL.
  • My domain name is sitename.com
  • My web account name is accname
  • My database name is dbname (really accname_dbname, verify correct name using cpanel or phpMySQL).
  • My MySQL username is dbuser (really accname_dbuser)
  • My password is passwrd.

Where I use specifics based on these assumptions , you should substitute your own site specifics

Here is what I learned thru great pain.

1. The directions were not clear to me. You need to install both PHAkt and the JDBC driver extensions.

Note from an expert: The driver extension can be donwloaded from www.udzone.com/go?1190 though you must remember that the JDBC connection method isn't the only way of doing it. If you don't plan on using any 3rd party utilities to manage your MySQL database then just using the JDBC driver is fine. If you want to use any Windows-based utilities (like MySQL Front or MASCON then you will need to install MyODBC). Not meaning to confuse the issue, just making you aware.

2. Before proceeding with running the installs on your specific site, doublecheck your site settings. In my case (standard virtual host setup), there is a directory public_html under my main ftp directory that is the main page for my web. I also like to have a dupliicate of my entire remote directory, so if my site is www.sitename.com, I set up a local directory on my disk called n:\sitename, and then download the existing files from the ftp directory. This leaves me with a public_html both on the remote site and the local site. This also means that my Dreamweaver site settings are as follow:

Fill in site definition fields not listed here as appropriate

Local Info
Local Root Folder - N:\sitename\public_html\
HTTP Address - http://www.sitename.com

Remote Info
Access - FTP
ftp Host - www.sitename.com
host directory - public_html/

Application Server
Model - PHP4.0
Host and host directory identical to above
URL prefix - http://www.sitename.com/ (this is critical, and NOT the UD default, also note trailing / )

This completes your site definition setup If you do not get this right, your adodb files will end up in the wrong place, and you will see error messages like "class not found".

3. Run ADODB installer from the COMMANDS menu in UD

Another Expert Note: You will need to install the extension first before you can do that, though with the current version of PHAkT you don't need to run this at all. The first time you create a connection the PHAkT PHP Server Model creates an ADODB folder for you and puts in the relevant files. I continue to maintain the ADODB installer because the authors tend to update it more often than the guys at Interakt can manage, and so I use the installer to bridge the gap. In this case you could remove this stage and reverse stages 4 and 5 below.

As I told you, I know what I know, and it worked my way for me.

4. Synchronize your site to upload all the adodb files to your server

5. Define a connection under Modify / Connections / New - This is where I stumbled badly.

Pick a connection name
DB Type - MySQL
Host - www.sitename.com
URL - jdbc:mysql://www.sitename.com/accname_dbname
User Name - accname_dbuser
Password - passwrd

DB Type - MySQL
Host - localhost
Database Name - accname_dbname
User Name - accname_dbuser
Password - passwrd

Hit the TEST button and you should be good to go.

[Possible Problem]

If you get an error message during the test that says something like "server connection denies access to data source" or "[TCX][MyODBC]Host'.IP.routername.DSLcompany.net' is not allowed to connect to the MySQL server", you need to talk to your hosting company.

They need to run the following from the MySQL command line using the root user. (note EXACT syntax, with .* and "%")

mysql> grant all privileges on accname_dbname.* to accname_dbuser@"%" identified by 'passwrd';
> Query OK, 0 rows affected (0.16 sec)
>
> mysql> quit

There may be a couple of other MySQL install settings that I am not aware of. Many hosts will refuse to do this for you. I ended up changing hosts rather than try to fight a losing battle with my hosting company. The MySQL manual calls this a security risk, and I suppose it is. But theory and practice often conflict. It took me three companies to find one that would open up access for me.

I hope this was helpful to some people, and in some way pays back the people who spent several days helping me get thru the problem.

Bob Costa

Comments

Could you provide more information connection on SQL 7.0

August 8, 2001 by jack Chan

Could you provide more information connection on SQL 7.0!

jack

Great PHP host.

September 3, 2001 by Ryan Dunbar

PHPwebhosting.com is a great host and was willing to allow remote access through UltraDev.

cant connect Help !!!!!!!!!

September 13, 2001 by michael cole
Hi,
Complete newbie .
Does this still apply and I am using odbc mysql .....I think.
Also If I change to local host I get
TCX myODBC cant connect to mySQL server on localhost (10061)

If you get an error message during the test that says something like "server connection denies access to data source" or "[TCX][MyODBC]Host'.IP.routername.DSLcompany.net' is not allowed to connect to the MySQL server", you need to talk to your hosting company.

They need to run the following from the MySQL command line using the root user. (note EXACT syntax, with .* and "%")

mysql> grant all privileges on accname_dbname.* to accname_dbuser@"%" identified by 'passwrd';
> Query OK, 0 rows affected (0.16 sec)
>
> mysql> quit

Also If I change to local host I get
TCX myODBC cant connect to mySQL server on localhost (10061)
Thanks in advance
Smiler

I still have troubles

October 16, 2001 by Ladonna Green
this is what comes back to me... org.gjt.mm.musql class not found. Also the jdbc does not seem to be seen even though I had a successful install; at least I think I did. Any thoughts???
See all 10 Comments

You must me logged in to write a comment.