aspose file tools*
The moose likes JDBC and the fly likes MySql Administrator gui Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySql Administrator gui" Watch "MySql Administrator gui" New topic
Author

MySql Administrator gui

Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
Running MySql Server 5.0 on Vista, I am having several problems setting up logging correctly.

I am not allowed to bounce the server through the Administrator GUI.
I'm guessing it is a permissions problem. How do I sort this out?

I have set the query log file name, but I think I need to set GLOBAL sql_log_off = 'ON';at the command line as I don't see how to do this through the GUI.

What is suggested to include in my.ini?

The goal is to see what a PreparedStatement is actually sending to the server; the PreparedStatement works at the command line but not within the servlet.

My lack of experience with these tools is showing because I have spent almost two days ( and nights! ) on this.

Thanks.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Mary Taylor wrote:The goal is to see what a PreparedStatement is actually sending to the server; the PreparedStatement works at the command line but not within the servlet.

Why not use System.out.println. Or a logging driver like jamon? Then you don't need admin privileges or to fiddle with MySql.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
System.out.println doesn't show the actual query that hits the database. I finally got
query logging working and was able to see that, for some reason, the parameter is
not being inserted in the PreparedStatement. When the query hits the db, the "?"
mark is still actually in the query! I have another successful query that looks exactly like the one
that fails; different columns are being queried, but the successful one has the value
set in the query whereas the unsuccessful one does not. I cannot see any difference in the
code.

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

I think Jamon does replace the values. In any case, you could post the query here with the "?" and see if anyone knows what is wrong. My guess would be a setXXX is incorrect.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Jeanne Boyarsky wrote:I think Jamon does replace the values. In any case, you could post the query here with the "?" and see if anyone knows what is wrong. My guess would be a setXXX is incorrect.

Which actually leads to a way you can troubleshoot. Start with the working query and start replacing values with "?" until you get the error. That will tell you which parameter is causing a problem.
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
There is only one parameter in both queries; it is set with setString in both cases.

My database tables are corrupted; I'm trying to restore from the output of mysqldump, but I can't seem to get the syntax correct. I will be able to work with the prepared statement problem when I get the database restored.

I'm using MySql 5.0.67.

From the bin directory I issue this command:

mysqld-nt –user=root –p papers < C:\MyProject\SqlQueries\MyProject200905272126.sql

Response is that there are too many parameters for "mysqld-nt". All the examples on the web do this at the command prompt using "mysql", but in 5.0, "mysql' became "mysqld-nt", etc.

Before someone yells at me for working as root, I do plan to create an admin user for this type of thing. Right now I don' t need to do that.



Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

mysqld-nt.exe is the executable for the service, not the command line utility used to enter sql statements. You should be using mysql.exe instead. There was no renaming of mysql to mysqld-nt in MySQL 5, the windows service has always been named mysqld-nt.exe, from what I recall. If you are missing mysql.exe, then I guess you probably unselected the option for the command line utilities during installation.


JBoss In Action
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
I'm as red faced as the staff at JavaRanch just said they are while working on their servers; anyway, I
have absolutely no idea what i was thinking because I do have mysql.exe. I need to get some sleep!
Stayed up way too late twice this week working on a project. Very sorry.

I still can't seem to get the syntax of the command correct, but hopefully soon I will.

Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
Just to let you know that I was able to restore the database tables and both queries worked. It's magic and 3 days work!

Thanks to all of you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySql Administrator gui