Re: Problems with a simple JSP and mySQL connect

2001-07-21 Thread Howler D. Wolfe

Hello everyone,

Thanks for your help on this. My problem did indeed turn out to be MySQL
related. After doing some more digging on Dejanews I found the following
link.

http://groups.google.com/groups?hl=ensafe=offth=976ec1cd8689bfcb,8seekm=3a5df3ac%241%40newsgate.hknet.com#p

I followed these directions exactly replacing my own userid and password
there and POOF! Everything worked.

Thanks to the author of this solution! :-)

Thanks
John Brosan

This what I did after researching here and in mysql web site:
1. Shutdown your mysql server and kill mysql process alive.
2. Start the server with command: ./bin/safe_mysqld --skip-grant-tables 
3. start mysql with command: ./bin/mysql --user root mysql
4. Once inside SQL: Issue the following commands ( replace with
appropriate user name and passwd etc. )
mysql INSERT INTO user
VALUES('localhost','monty',PASSWORD('some_pass'),
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')
mysql INSERT INTO user VALUES('%','monty',PASSWORD('some_pass'),
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')
mysql INSERT INTO user SET Host='localhost',User='admin',
 Reload_priv='Y', Process_priv='Y';
mysql INSERT INTO user (Host,User,Password)
VALUES('localhost','dummy','');
mysql FLUSH PRIVILEGES;
5. quit from mysql and kill any mysql process alive
6. start the server with command: ./bin/safe_mysqld

Now you should be able to use user monty and passwd some_pass to connect
to the server.

Hope it helps.
susilkp

Simon Chan wrote:

 Your connection string should be
 
 jdbc:mysql://localhost/howlerdb?user=howlerpassword=winston2644
 
 if howlerdb is your db name
 
 skc
 
 Howler D. Wolfe wrote:
 
 Currently, I have it all on 1 machine, Tomcat, Apache, and MySQL, larry,
 and I am logged in as howler
 
 Simon Chan wrote:
 
  Which machine (host) and what db account you access the database from?
 
  Howler D. Wolfe wrote:
 
  I have data in this table as follows
 
  HOST USER PW PRIVS (shortened to save space)
  ---+-+---+---
  localhost root  All are set to 'Y'
  larry root (empty) All are set to 'Y'
  localhost (empty) (empty) All are set to 'N'
  larry (empty) (empty) All are set to 'N'
  localhost howler  All are set to 'Y'
 
  Not sure whats going on with this or what exactly should be here.
 
  Any suggestions would be helpful
 
  Thanks
  John Brosan
 
  Simon Chan wrote:
 
   Please check your mysql.user table to make sure that your client
  machine is in the host field.
  
   skc
  
   Howler D. Wolfe wrote:
  
   Hello Everyone,
  
   I apologize if this has been answered in a previous post. I've
  been digging through old posts and
   and searching on the net for an answer to this problem.
  
   I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the
  latest version). I am able to
   run the examples without a hitch. I am new to Java, JSP and MySQL,
  I have created a database with
   two tables, when I try to use the MySQL driver to connect to the
  database I get the following error.
  
   I think I get this error because I don't have a user other than
  root setup on MySQL. In my searching
   for an answer, I read about using the URL of the MySQL db as part
  of getConnection(). I tried this
   and it failed due to the MySQL port not being open on my firewall.
  After I opened the appropriate
   port, I got the same error.
  
   What have I failed to do when setting up MySQL? I've installed it,
  ran the grants, I think I've done
   what was supposed to be done.
  
   I've used the user id of root with the password I set for it.
  
   Partial Error Text follows:
   *
   java.sql.SQLException: Server configuration denies access to data
  source*
  
   Thanks in advance
   John Brosan
  
 
  --
  Simon Chan, Senior System Analyst, Rawmart.com, Inc.
  17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
  Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
 
  http://www.rawmart.com , the next dimension in the trading of
  raw materials, please register now.
 
  An initiative of the Noble Group. Please visit us at
  http://www.thisisnoble.com
 
 -- 
 Simon Chan, Senior System Analyst, Rawmart.com, Inc.
 17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
 Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
 
 http://www.rawmart.com , the next dimension in the trading of
 raw materials, please register now.
 
 An initiative of the Noble Group.  Please visit us at
 http://www.thisisnoble.com






Re: Problems with a simple JSP and mySQL connect

2001-07-19 Thread Adam Myatt

To further expand on the last answer below: if you look at the MANUAL that
comes in the DOC folder of the MySQL installation, section 6.16 Causes of
Access Denied Errors:

'If you can't get your password to work, remember that you must use the
PASSWORD() function if you set the password with the INSERT, UPDATE, or SET
PASSWORD statements. The PASSWORD() function is unnecessary if you specify
the password using the GRANT ... INDENTIFIED BY statement or the mysqladmin
password command. See section 6.15 Setting Up Passwords. '

A sample would be:

insert into mysql.user
values('larry','root',password('larrys_password'),'Y','Y','Y',etc)

When you try to compare against the password field in mysql.user, the
password passed in is automatically encrypted and the encrypted value is
compared against whatever is in the mysql.password field. A more detailed
explanation is in section 6.15 Setting Up Passwords of the manual.

Hope that helps. Sorry if my answer was long and redundant, but I had this
same problem a while ago and it stressed me to the point where I don't want
anyone else to have to suffer it. :)

 - Adam


At 11:22 AM 7/19/2001 +0800, you wrote:

This is actually a mysql question.  What you can do as follows:

insert a row into mysql.user such that host = larry, user = root, password
= encrypted pwd (you can copy from the
existing row -- localhost | root | ... )

skc





Problems with a simple JSP and mySQL connect

2001-07-18 Thread Howler D. Wolfe

   

Hello Everyone,

I apologize if this has been answered in a previous post. I've been digging through 
old posts and
and searching on the net for an answer to this problem.

I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the latest version).  I 
am able to 
run the examples without a hitch. I am new to Java, JSP and MySQL, I have created a 
database with 
two tables, when I try to use the MySQL driver to connect to the database I get the 
following error.

I think I get this error because I don't have a user other than root setup on MySQL. 
In my searching
for an answer, I read about using the URL of the MySQL db as part of getConnection().  
I tried this
and it failed due to the MySQL port not being open on my firewall. After I opened the 
appropriate 
port, I got the same error.

What have I failed to do when setting up MySQL? I've installed it, ran the grants, I 
think I've done
what was supposed to be done.

I've used the user id of root with the password I set for it.

Partial Error Text follows:
*
java.sql.SQLException: Server configuration denies access to data source*

Thanks in advance
John Brosan




Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Howler D. Wolfe

I have data in this table as follows

HOST USER PW PRIVS (shortened to save space)
---+-+---+---
localhost root  All are set to 'Y'
larry root (empty) All are set to 'Y'
localhost (empty) (empty) All are set to 'N'
larry (empty) (empty) All are set to 'N'
localhost howler  All are set to 'Y'

Not sure whats going on with this or what exactly should be here.

Any suggestions would be helpful

Thanks
John Brosan


Simon Chan wrote:

 Please check your mysql.user table to make sure that your client machine is in the 
host field.
 
 skc
 
 Howler D. Wolfe wrote:
 
 Hello Everyone,
 
 I apologize if this has been answered in a previous post. I've been digging through 
old posts and
 and searching on the net for an answer to this problem.
 
 I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the latest version).  
I am able to
 run the examples without a hitch. I am new to Java, JSP and MySQL, I have created a 
database with
 two tables, when I try to use the MySQL driver to connect to the database I get the 
following error.
 
 I think I get this error because I don't have a user other than root setup on 
MySQL. In my searching
 for an answer, I read about using the URL of the MySQL db as part of 
getConnection().  I tried this
 and it failed due to the MySQL port not being open on my firewall. After I opened 
the appropriate
 port, I got the same error.
 
 What have I failed to do when setting up MySQL? I've installed it, ran the grants, 
I think I've done
 what was supposed to be done.
 
 I've used the user id of root with the password I set for it.
 
 Partial Error Text follows:
 *
 java.sql.SQLException: Server configuration denies access to data source*
 
 Thanks in advance
 John Brosan
 





Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Matt Read

You'll need to show the code you use to establish the connection, in the
meantime here's an example of some lines of code I use to establish a
connection that works, hopefully this will help...

import java.sql.*;

public class MyClass {

public MyClass() throws SQLException {
Class.forName(org.gjt.mm.mysql.Driver).newInstance();
Connection  c =
DriverManager.getConnection(jdbc:mysql://mymachine.mydomain.com/mySqlDataba
seName?user=myUserNamepassword=myPassword);
}

}


Matt.

- Original Message -
From: Howler D. Wolfe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 18 July 2001 14:19
Subject: Problems with a simple JSP and mySQL connect


 

 Hello Everyone,

 I apologize if this has been answered in a previous post. I've been
digging through old posts and
 and searching on the net for an answer to this problem.

 I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the latest
version).  I am able to
 run the examples without a hitch. I am new to Java, JSP and MySQL, I have
created a database with
 two tables, when I try to use the MySQL driver to connect to the database
I get the following error.

 I think I get this error because I don't have a user other than root setup
on MySQL. In my searching
 for an answer, I read about using the URL of the MySQL db as part of
getConnection().  I tried this
 and it failed due to the MySQL port not being open on my firewall. After I
opened the appropriate
 port, I got the same error.

 What have I failed to do when setting up MySQL? I've installed it, ran the
grants, I think I've done
 what was supposed to be done.

 I've used the user id of root with the password I set for it.

 Partial Error Text follows:
 *
 java.sql.SQLException: Server configuration denies access to data source*

 Thanks in advance
 John Brosan





Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Simon Chan


Which machine (host) and what db account you access the database from?
"Howler D. Wolfe" wrote:
I have data in this table as follows
HOST USER PW PRIVS (shortened to save space)
---+-+---+---
localhost root  All are set to 'Y'
larry root (empty) All are set to 'Y'
localhost (empty) (empty) All are set to 'N'
larry (empty) (empty) All are set to 'N'
localhost howler  All are set to 'Y'
Not sure whats going on with this or what exactly should be here.
Any suggestions would be helpful
Thanks
John Brosan
Simon Chan wrote:
> Please check your mysql.user table to make sure that your client machine
is in the host field.
>
> skc
>
> "Howler D. Wolfe" wrote:
>
>> Hello Everyone,
>>
>> I apologize if this has been answered in a previous post. I've been
digging through old posts and
>> and searching on the net for an answer to this problem.
>>
>> I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the
latest version). I am able to
>> run the examples without a hitch. I am new to Java, JSP and MySQL,
I have created a database with
>> two tables, when I try to use the MySQL driver to connect to the
database I get the following error.
>>
>> I think I get this error because I don't have a user other than
root setup on MySQL. In my searching
>> for an answer, I read about using the URL of the MySQL db as part
of getConnection(). I tried this
>> and it failed due to the MySQL port not being open on my firewall.
After I opened the appropriate
>> port, I got the same error.
>>
>> What have I failed to do when setting up MySQL? I've installed it,
ran the grants, I think I've done
>> what was supposed to be done.
>>
>> I've used the user id of "root" with the password I set for it.
>>
>> Partial Error Text follows:
>> *
>> java.sql.SQLException: Server configuration denies access to data
source*
>>
>> Thanks in advance
>> John Brosan
>

--
Simon Chan, Senior System Analyst, Rawmart.com, Inc.
17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]

http://www.rawmart.com , the next dimension in the trading of
raw materials, please register now.

An initiative of the Noble Group. Please visit us at
http://www.thisisnoble.com



Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Howler D. Wolfe

Here is the code I am using.

Please try not to laugh too much, keep in mind I am new to JSP and Java. ;-)

Thanks
John Brosan

%@page contentType=text/html import=java.sql.* %

html
body

%= new String(Hello there John) %
%
Class.forName(org.gjt.mm.mysql.Driver);
Connection con = 
DriverManager.getConnection(jdbc:mysql:///howlerdb,howler, 
winston2644);

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(SELECT * FROM tblMenu);

while (rs.next())
  {
  out.println(rs.getString(MnuItemName));
  out.println(BR);
  }
try {
   if ( rs!=null  ) rs.close();
   if ( stmt!=null) stmt.close();
   if ( con!=null ) con.close();

}
catch (SQLException ignored) {}
%


/body
/html




Matt Read wrote:

 You'll need to show the code you use to establish the connection, in the
 meantime here's an example of some lines of code I use to establish a
 connection that works, hopefully this will help...
 
 import java.sql.*;
 
 public class MyClass {
 
 public MyClass() throws SQLException {
 Class.forName(org.gjt.mm.mysql.Driver).newInstance();
 Connection  c =
 DriverManager.getConnection(jdbc:mysql://mymachine.mydomain.com/mySqlDataba
 seName?user=myUserNamepassword=myPassword);
 }
 
 }
 
 
 Matt.
 
 - Original Message -
 From: Howler D. Wolfe [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: 18 July 2001 14:19
 Subject: Problems with a simple JSP and mySQL connect
 
 
 Hello Everyone,
 
 I apologize if this has been answered in a previous post. I've been
 
 digging through old posts and
 
 and searching on the net for an answer to this problem.
 
 I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the latest
 
 version).  I am able to
 
 run the examples without a hitch. I am new to Java, JSP and MySQL, I have
 
 created a database with
 
 two tables, when I try to use the MySQL driver to connect to the database
 
 I get the following error.
 
 I think I get this error because I don't have a user other than root setup
 
 on MySQL. In my searching
 
 for an answer, I read about using the URL of the MySQL db as part of
 
 getConnection().  I tried this
 
 and it failed due to the MySQL port not being open on my firewall. After I
 
 opened the appropriate
 
 port, I got the same error.
 
 What have I failed to do when setting up MySQL? I've installed it, ran the
 
 grants, I think I've done
 
 what was supposed to be done.
 
 I've used the user id of root with the password I set for it.
 
 Partial Error Text follows:
 *
 java.sql.SQLException: Server configuration denies access to data source*
 
 Thanks in advance
 John Brosan
 





Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Howler D. Wolfe

Currently, I have it all on 1 machine, Tomcat, Apache, and MySQL, larry,
and I am logged in as howler

Simon Chan wrote:

 Which machine (host) and what db account you access the database from?
 
 Howler D. Wolfe wrote:
 
 I have data in this table as follows
 
 HOST USER PW PRIVS (shortened to save space)
 ---+-+---+---
 localhost root  All are set to 'Y'
 larry root (empty) All are set to 'Y'
 localhost (empty) (empty) All are set to 'N'
 larry (empty) (empty) All are set to 'N'
 localhost howler  All are set to 'Y'
 
 Not sure whats going on with this or what exactly should be here.
 
 Any suggestions would be helpful
 
 Thanks
 John Brosan
 
 Simon Chan wrote:
 
  Please check your mysql.user table to make sure that your client
 machine is in the host field.
 
  skc
 
  Howler D. Wolfe wrote:
 
  Hello Everyone,
 
  I apologize if this has been answered in a previous post. I've
 been digging through old posts and
  and searching on the net for an answer to this problem.
 
  I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the
 latest version). I am able to
  run the examples without a hitch. I am new to Java, JSP and MySQL,
 I have created a database with
  two tables, when I try to use the MySQL driver to connect to the
 database I get the following error.
 
  I think I get this error because I don't have a user other than
 root setup on MySQL. In my searching
  for an answer, I read about using the URL of the MySQL db as part
 of getConnection(). I tried this
  and it failed due to the MySQL port not being open on my firewall.
 After I opened the appropriate
  port, I got the same error.
 
  What have I failed to do when setting up MySQL? I've installed it,
 ran the grants, I think I've done
  what was supposed to be done.
 
  I've used the user id of root with the password I set for it.
 
  Partial Error Text follows:
  *
  java.sql.SQLException: Server configuration denies access to data
 source*
 
  Thanks in advance
  John Brosan
 
 
 -- 
 Simon Chan, Senior System Analyst, Rawmart.com, Inc.
 17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
 Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
 
 http://www.rawmart.com , the next dimension in the trading of
 raw materials, please register now.
 
 An initiative of the Noble Group.  Please visit us at
 http://www.thisisnoble.com






Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Howler D. Wolfe

Simon,

I miss read your question. The host machine is larry and the db
account I use is root I hope that clarifies things.

Thanks again
John Brosan


Simon Chan wrote:

 Which machine (host) and what db account you access the database from?
 
 Howler D. Wolfe wrote:
 
 I have data in this table as follows
 
 HOST USER PW PRIVS (shortened to save space)
 ---+-+---+---
 localhost root  All are set to 'Y'
 larry root (empty) All are set to 'Y'
 localhost (empty) (empty) All are set to 'N'
 larry (empty) (empty) All are set to 'N'
 localhost howler  All are set to 'Y'
 
 Not sure whats going on with this or what exactly should be here.
 
 Any suggestions would be helpful
 
 Thanks
 John Brosan
 
 Simon Chan wrote:
 
  Please check your mysql.user table to make sure that your client
 machine is in the host field.
 
  skc
 
  Howler D. Wolfe wrote:
 
  Hello Everyone,
 
  I apologize if this has been answered in a previous post. I've
 been digging through old posts and
  and searching on the net for an answer to this problem.
 
  I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the
 latest version). I am able to
  run the examples without a hitch. I am new to Java, JSP and MySQL,
 I have created a database with
  two tables, when I try to use the MySQL driver to connect to the
 database I get the following error.
 
  I think I get this error because I don't have a user other than
 root setup on MySQL. In my searching
  for an answer, I read about using the URL of the MySQL db as part
 of getConnection(). I tried this
  and it failed due to the MySQL port not being open on my firewall.
 After I opened the appropriate
  port, I got the same error.
 
  What have I failed to do when setting up MySQL? I've installed it,
 ran the grants, I think I've done
  what was supposed to be done.
 
  I've used the user id of root with the password I set for it.
 
  Partial Error Text follows:
  *
  java.sql.SQLException: Server configuration denies access to data
 source*
 
  Thanks in advance
  John Brosan
 
 
 -- 
 Simon Chan, Senior System Analyst, Rawmart.com, Inc.
 17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
 Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
 
 http://www.rawmart.com , the next dimension in the trading of
 raw materials, please register now.
 
 An initiative of the Noble Group.  Please visit us at
 http://www.thisisnoble.com






Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Simon Chan


Your connection string should be
jdbc:mysql://localhost/howlerdb?user=howlerpassword=winston2644
if howlerdb is your db name
skc
"Howler D. Wolfe" wrote:
Currently, I have it all on 1 machine, Tomcat, Apache,
and MySQL, larry,
and I am logged in as "howler"
Simon Chan wrote:
> Which machine (host) and what db account you access the database from?
>
> "Howler D. Wolfe" wrote:
>
>> I have data in this table as follows
>>
>> HOST USER PW PRIVS (shortened to save space)
>> ---+-+---+---
>> localhost root  All are set to 'Y'
>> larry root (empty) All are set to 'Y'
>> localhost (empty) (empty) All are set to 'N'
>> larry (empty) (empty) All are set to 'N'
>> localhost howler  All are set to 'Y'
>>
>> Not sure whats going on with this or what exactly should be here.
>>
>> Any suggestions would be helpful
>>
>> Thanks
>> John Brosan
>>
>> Simon Chan wrote:
>>
>> > Please check your mysql.user table to make sure that your client
>> machine is in the host field.
>> >
>> > skc
>> >
>> > "Howler D. Wolfe" wrote:
>> >
>> >> Hello Everyone,
>> >>
>> >> I apologize if this has been answered in a previous post. I've
>> been digging through old posts and
>> >> and searching on the net for an answer to this problem.
>> >>
>> >> I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think
the
>> latest version). I am able to
>> >> run the examples without a hitch. I am new to Java, JSP and MySQL,
>> I have created a database with
>> >> two tables, when I try to use the MySQL driver to connect to
the
>> database I get the following error.
>> >>
>> >> I think I get this error because I don't have a user other than
>> root setup on MySQL. In my searching
>> >> for an answer, I read about using the URL of the MySQL db as
part
>> of getConnection(). I tried this
>> >> and it failed due to the MySQL port not being open on my firewall.
>> After I opened the appropriate
>> >> port, I got the same error.
>> >>
>> >> What have I failed to do when setting up MySQL? I've installed
it,
>> ran the grants, I think I've done
>> >> what was supposed to be done.
>> >>
>> >> I've used the user id of "root" with the password I set for it.
>> >>
>> >> Partial Error Text follows:
>> >> *
>> >> java.sql.SQLException: Server configuration denies access to
data
>> source*
>> >>
>> >> Thanks in advance
>> >> John Brosan
>> >
>>
> --
> Simon Chan, Senior System Analyst, Rawmart.com, Inc.
> 17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
> Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
>
> http://www.rawmart.com , the
next dimension in the trading of
> raw materials, please register now.
>
> An initiative of the Noble Group. Please visit us at
> http://www.thisisnoble.com

--
Simon Chan, Senior System Analyst, Rawmart.com, Inc.
17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]

http://www.rawmart.com , the next dimension in the trading of
raw materials, please register now.

An initiative of the Noble Group. Please visit us at
http://www.thisisnoble.com



Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Matt Read

Your code should probably look something like this. Note there is no
connection between Unix account and mySql accounts.

Connection con =
DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=rootpassword=
rootpassword);

or if you're trying to log in as howler

Connection con =
DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=howlerpasswor
d=winston2644);

Either should work as long as you're connecting from localhost.

Matt.


- Original Message -
From: Howler D. Wolfe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 18 July 2001 15:14
Subject: Re: Problems with a simple JSP and mySQL connect


 Simon,

 I miss read your question. The host machine is larry and the db
 account I use is root I hope that clarifies things.

 Thanks again
 John Brosan


 Simon Chan wrote:

  Which machine (host) and what db account you access the database from?
 
  Howler D. Wolfe wrote:
 
  I have data in this table as follows
 
  HOST USER PW PRIVS (shortened to save space)
  ---+-+---+---
  localhost root  All are set to 'Y'
  larry root (empty) All are set to 'Y'
  localhost (empty) (empty) All are set to 'N'
  larry (empty) (empty) All are set to 'N'
  localhost howler  All are set to 'Y'
 
  Not sure whats going on with this or what exactly should be here.
 
  Any suggestions would be helpful
 
  Thanks
  John Brosan
 
  Simon Chan wrote:
 
   Please check your mysql.user table to make sure that your client
  machine is in the host field.
  
   skc
  
   Howler D. Wolfe wrote:
  
   Hello Everyone,
  
   I apologize if this has been answered in a previous post. I've
  been digging through old posts and
   and searching on the net for an answer to this problem.
  
   I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the
  latest version). I am able to
   run the examples without a hitch. I am new to Java, JSP and MySQL,
  I have created a database with
   two tables, when I try to use the MySQL driver to connect to the
  database I get the following error.
  
   I think I get this error because I don't have a user other than
  root setup on MySQL. In my searching
   for an answer, I read about using the URL of the MySQL db as part
  of getConnection(). I tried this
   and it failed due to the MySQL port not being open on my firewall.
  After I opened the appropriate
   port, I got the same error.
  
   What have I failed to do when setting up MySQL? I've installed it,
  ran the grants, I think I've done
   what was supposed to be done.
  
   I've used the user id of root with the password I set for it.
  
   Partial Error Text follows:
   *
   java.sql.SQLException: Server configuration denies access to data
  source*
  
   Thanks in advance
   John Brosan
  
 
  --
  Simon Chan, Senior System Analyst, Rawmart.com, Inc.
  17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
  Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
 
  http://www.rawmart.com , the next dimension in the trading of
  raw materials, please register now.
 
  An initiative of the Noble Group.  Please visit us at
  http://www.thisisnoble.com







Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Howler D. Wolfe

I've made the suggested changes and I now receive the foloowing eror:

java.sql.SQLException: Invalid authorization specification: Access denied for user: 
'root@larry' (Using password: YES)
Here is the updated code...any more suggestions?

Connection con = 
DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=rootpassword=winston2644);

Thanks
John Brosan




Matt Read wrote:

 Your code should probably look something like this. Note there is no
 connection between Unix account and mySql accounts.
 
 Connection con =
 DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=rootpassword=
 rootpassword);
 
 or if you're trying to log in as howler
 
 Connection con =
 DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=howlerpasswor
 d=winston2644);
 
 Either should work as long as you're connecting from localhost.
 
 Matt.
 
 
 - Original Message -
 From: Howler D. Wolfe [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: 18 July 2001 15:14
 Subject: Re: Problems with a simple JSP and mySQL connect
 
 
 Simon,
 
 I miss read your question. The host machine is larry and the db
 account I use is root I hope that clarifies things.
 
 Thanks again
 John Brosan
 
 
 Simon Chan wrote:
 
 Which machine (host) and what db account you access the database from?
 
 Howler D. Wolfe wrote:
 
 I have data in this table as follows
 
 HOST USER PW PRIVS (shortened to save space)
 ---+-+---+---
 localhost root  All are set to 'Y'
 larry root (empty) All are set to 'Y'
 localhost (empty) (empty) All are set to 'N'
 larry (empty) (empty) All are set to 'N'
 localhost howler  All are set to 'Y'
 
 Not sure whats going on with this or what exactly should be here.
 
 Any suggestions would be helpful
 
 Thanks
 John Brosan
 
 Simon Chan wrote:
 
 Please check your mysql.user table to make sure that your client
 
 machine is in the host field.
 
 skc
 
 Howler D. Wolfe wrote:
 
 Hello Everyone,
 
 I apologize if this has been answered in a previous post. I've
 
 been digging through old posts and
 
 and searching on the net for an answer to this problem.
 
 I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the
 
 latest version). I am able to
 
 run the examples without a hitch. I am new to Java, JSP and MySQL,
 
 I have created a database with
 
 two tables, when I try to use the MySQL driver to connect to the
 
 database I get the following error.
 
 I think I get this error because I don't have a user other than
 
 root setup on MySQL. In my searching
 
 for an answer, I read about using the URL of the MySQL db as part
 
 of getConnection(). I tried this
 
 and it failed due to the MySQL port not being open on my firewall.
 
 After I opened the appropriate
 
 port, I got the same error.
 
 What have I failed to do when setting up MySQL? I've installed it,
 
 ran the grants, I think I've done
 
 what was supposed to be done.
 
 I've used the user id of root with the password I set for it.
 
 Partial Error Text follows:
 *
 java.sql.SQLException: Server configuration denies access to data
 
 source*
 
 Thanks in advance
 John Brosan
 
 --
 Simon Chan, Senior System Analyst, Rawmart.com, Inc.
 17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
 Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
 
 http://www.rawmart.com , the next dimension in the trading of
 raw materials, please register now.
 
 An initiative of the Noble Group.  Please visit us at
 http://www.thisisnoble.com
 





Re: Problems with a simple JSP and mySQL connect

2001-07-18 Thread Simon Chan

This is actually a mysql question.  What you can do as follows:

insert a row into mysql.user such that host = larry, user = root, password = 
encrypted pwd (you can copy from the
existing row -- localhost | root | ... )

skc

Howler D. Wolfe wrote:

 I've made the suggested changes and I now receive the foloowing eror:

 java.sql.SQLException: Invalid authorization specification: Access denied for user: 
'root@larry' (Using password: YES)
 Here is the updated code...any more suggestions?

 Connection con = 
DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=rootpassword=winston2644);

 Thanks
 John Brosan

 Matt Read wrote:

  Your code should probably look something like this. Note there is no
  connection between Unix account and mySql accounts.
 
  Connection con =
  DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=rootpassword=
  rootpassword);
 
  or if you're trying to log in as howler
 
  Connection con =
  DriverManager.getConnection(jdbc:mysql://larry/howlerdb?user=howlerpasswor
  d=winston2644);
 
  Either should work as long as you're connecting from localhost.
 
  Matt.
 
 
  - Original Message -
  From: Howler D. Wolfe [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: 18 July 2001 15:14
  Subject: Re: Problems with a simple JSP and mySQL connect
 
 
  Simon,
 
  I miss read your question. The host machine is larry and the db
  account I use is root I hope that clarifies things.
 
  Thanks again
  John Brosan
 
 
  Simon Chan wrote:
 
  Which machine (host) and what db account you access the database from?
 
  Howler D. Wolfe wrote:
 
  I have data in this table as follows
 
  HOST USER PW PRIVS (shortened to save space)
  ---+-+---+---
  localhost root  All are set to 'Y'
  larry root (empty) All are set to 'Y'
  localhost (empty) (empty) All are set to 'N'
  larry (empty) (empty) All are set to 'N'
  localhost howler  All are set to 'Y'
 
  Not sure whats going on with this or what exactly should be here.
 
  Any suggestions would be helpful
 
  Thanks
  John Brosan
 
  Simon Chan wrote:
 
  Please check your mysql.user table to make sure that your client
 
  machine is in the host field.
 
  skc
 
  Howler D. Wolfe wrote:
 
  Hello Everyone,
 
  I apologize if this has been answered in a previous post. I've
 
  been digging through old posts and
 
  and searching on the net for an answer to this problem.
 
  I am runnin Tomcat 3.2.2 and Apache 1.3.19 and MySQL (I think the
 
  latest version). I am able to
 
  run the examples without a hitch. I am new to Java, JSP and MySQL,
 
  I have created a database with
 
  two tables, when I try to use the MySQL driver to connect to the
 
  database I get the following error.
 
  I think I get this error because I don't have a user other than
 
  root setup on MySQL. In my searching
 
  for an answer, I read about using the URL of the MySQL db as part
 
  of getConnection(). I tried this
 
  and it failed due to the MySQL port not being open on my firewall.
 
  After I opened the appropriate
 
  port, I got the same error.
 
  What have I failed to do when setting up MySQL? I've installed it,
 
  ran the grants, I think I've done
 
  what was supposed to be done.
 
  I've used the user id of root with the password I set for it.
 
  Partial Error Text follows:
  *
  java.sql.SQLException: Server configuration denies access to data
 
  source*
 
  Thanks in advance
  John Brosan
 
  --
  Simon Chan, Senior System Analyst, Rawmart.com, Inc.
  17/F MassMutual Tower, 38 Gloucester Rd, Hong Kong SAR, China
  Tel: +852 2861-4564. Fax: +852 2865-3865. Email: [EMAIL PROTECTED]
 
  http://www.rawmart.com , the next dimension in the trading of
  raw materials, please register now.
 
  An initiative of the Noble Group.  Please visit us at
  http://www.thisisnoble.com