Koozali.org: home of the SME Server

MySQL connection problems !

Benson

MySQL connection problems !
« on: November 13, 2002, 12:54:28 AM »
Hi !

I've installed MySQL for win98 on my PC !

I've Installed PHPMyAdmin on my SME 5.5

I've created a new db on Mysql through the phpmyadmin

I'm using this connection string in ASP script !


--------------- SCRIPT START ------------------


SQLserveradr="192.168.176.1"
SQLdatabase="hojholt"
SQLlogin="bnh"
SQLpassword="717280"

Set objConn = Server.CreateObject("ADODB.Connection")

conStr = "driver={MySql};server="& SQLserveradr &";database="& SQLdatabase
conStr = conStr & ";uid="& SQLlogin &";pwd="& SQLpassword & ";OPTION=16386"

objConn.Open conStr

Set objRS=Server.CreateObject("ADODB.Recordset")
set objRS.ActiveConnection=objConn

tempSQL="SELECT * FROM test WHERE 1"

objRS.Open tempSQL

hovedindhold=""

While not objRS.EOF
   hovedindhold=hovedindhold & objRS("navn") & " - " & objrs("nummer") & "
" & vbCrLf
   objRS.MoveNext
Wend

objRS.Close
objConn.Close
set objRS=Nothing
set objConn=Nothing
--------------- SCRIPT END ------------------

I've created priviliges to any user to "select, Insert, Delete, update"

But who ever I enter as SQLlogin, I get the message:

------------- ERROR MSG---------------
Microsoft OLE DB Provider for ODBC Drivers fejl '80004005'

[TCX][MyODBC]Access denied for user: 'bnh@pc-00065' (Using password: YES)

/hojholt/lm/testMy.asp, linje 14
------------- ERROR MSG END -----------

I even tried to open port 3306, but that didn't work either !

Please help, anyone knows whats wrong ?

Benson

Benson

Re: MySQL connection problems !
« Reply #1 on: November 13, 2002, 01:01:35 AM »
PS ! The asp-script runs on my client WIN98 PC, trying to connect to the SME 5.5 MySql

Benson

John

Re: MySQL connection problems !
« Reply #2 on: November 13, 2002, 06:36:40 AM »
I think that you need to allow the [user]@[win98 machine IP]

but then I could be wrong...  give it a shot

mysql> GRANT ALL PRIVILEGES ON hojholt.* TO bnh@192.168.176.X
    ->     IDENTIFIED BY '717280' WITH GRANT OPTION;



you may also want to refer to http://www.mysql.com/doc/en/Adding_users.html

just smile

Dan Brown

Re: MySQL connection problems !
« Reply #3 on: November 13, 2002, 06:39:54 AM »
...and if not the IP, try the name (pc-00065).

Benson

Re: MySQL connection problems !
« Reply #4 on: November 13, 2002, 09:45:46 PM »
Hi !

I will try your suggestions tonight (wed. 13. now. )

I'll be back with a comment !

Thanks
Benson
:-)

... and keep smiling

Benson

Re: MySQL connection problems !
« Reply #5 on: November 13, 2002, 10:58:17 PM »
Hi again !

yeepee It worked !

Know I can connect from my client Win98 PC Thanks..

But....
I only use my client pc for test. When i'm finished with the test, I upload my ASP file to my web server at a ISP (WEB host).

Now... How do I allow those webusers to acces my MySql database ?

I've already open port 3306 (If necessary at all).

My web is www.mylastname.dk But I do not think that it has a unik IP@.

Any ideas ?

Benson

john

Re: MySQL connection problems !
« Reply #6 on: November 14, 2002, 01:35:06 AM »
if the database resides on the server that is hosting the website, then the database connection should use [user]@localhost

john

Re: MySQL connection problems !
« Reply #7 on: November 14, 2002, 08:15:32 AM »
upon reading your last post again...  
I see you will need to follow the same process, but use bnh@[webhost IP] instead.

This should allow all visitors to your website to interact with the database running on your sme server.  ( in theory )

still smiling...

Benson

Re: MySQL connection problems !
« Reply #8 on: November 21, 2002, 10:41:19 AM »
Hey again !

Yep it worked too, after I opened port 3306 !!

Thought I did that before, but I didn“t.

Thank You :-)

benson
and I'm smiling even more....
It'll soon be christmas, and my kid still believes in Santa, yeepee