tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howler D. Wolfe" <how...@bigbadwolf.org>
Subject Re: Problems with a simple JSP and mySQL connect
Date Sat, 21 Jul 2001 09:34:09 GMT
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=en&safe=off&th=976ec1cd8689bfcb,8&seekm=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=howler&password=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 9999 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 9999 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: simon@rawmart.com
>> >
>> > 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: simon@rawmart.com
> 
> 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




Mime
View raw message