Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Java In Linux (Redhat 9) To Access MySQL


Using a Java program, I can connect to the test database in MySQL. The
test database is installed using a MySQL utility, and it can be accessed
by any user without supplying a password. The relevant lines in my Java
(Java version 1.4.1) code are:

Connection con = null;
String url = "jdbc:mysql:///test"; // <== no user or password specified
con = DriverManager.getConnection(url);

However, when I try to connect to the accounting database (built as one
follows the Larry Ullman's "MySQL" book), the program fails. I need to
supply a user and a password. The relevant lines are now:

Connection con = null;
String url = "jdbc:mysql:///accounting?user=root&password=pswd"; // <==
con = DriverManager.getConnection(url);

I cannot get a connection. The error message is:

"Invalid authorization specification: Access denied for user:
'root@thorvald' (Using password: YES)"

(thorvald is my machine name.)

I have tried all sorts of variations on the url, trying to access the
accounting database, with no success. I can use the same user/password
of root/pswd within the mysql monitor to access anything I want.

Any ideas?

Again, I am using Linux (Redhat 9) , Java 1.4.1, MySQL 4.0.13, and the
MySQL ConnectorJ 3.0.8 (for Java access to MySQL).




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MySQL On Redhat Linux
To make a long story short, let me say I had MySQL working on Windows 98
and everything was fine. Well, I took the big leap and removed all
traces of Windows and Microsoft from the computer. (hooray!) Once I had
Linux running OK, I downloaded and installed MySQL using an RPM package.
I guess the server is running (it says it is every time the computer
starts and it stops successfully every time the computer shuts down)
however, I cannot figure out how to get the MySQL prompt.

I've searched the entire hard drive for MySQL, mysql, MySQL*, mysql* and
probably some others, too. The only thing I found was a shell script
called mysql that starts or stops the server if I am logged in to Linux
as root. I cannot figure out how to start the interactive program that
allows me to make select statements, inserts, updates, etc.
I'm wondering about some things:

Did I download and install the wrong thing?
Am I just not looking for the correct thing?

Did I install it incorrectly?

Activating MySQL In RedHat Linux 9
After being absent for a while now I'm back with this question: Does anyone know of any guide on how to start mysql on Linux? Actually I was writing a long complain that mysql doesn't run on linux! But during the writing I could sort of fix it! Now it works, but only the mysql & test databases are not active coz their directory isn't created. I think I can do something for it myself! I just wanted to know if any of you went through the same experience: running mysql that is already installed with your Linux package, not grabbing a new mysql and deleting the old one and installing the new one!

Multiple Mysql Servers On Linux RedHat
I am trying to figure out how to install 2 different versions of MySQL, 4.x and 5.x on a Redhat 3 server.

Cannot Start New Install Of MySQL On RedHat Enterprise Linux
I've recently installed MySQL and PHP using YUM on a RedHat Enterprise Linux (RHEL 3) box. The output from rpm -ql | grep -i mysql shows the following are installed: Code:

Connect Mysql5 Using C++ In Redhat-linux
how to connect MySQL using C++ in redhat ....

can any one tell a sample of code to creat ,connect and execute the
statement in c++ code ...

Mysqld_multi Don't Starts Groups On Linux RedHat 9
mysqld_multi doesn't start the two groups if I gave this command imediately
after stopping them.

Mysqld_multi Don't Starts Groups On Linux RedHat 9
mysqld_multi doesn't start the two groups if I gave this command imediately
after stopping them.

Mysqld_multi Don't Starts Groups On Linux RedHat 9
mysqld_multi doesn't start the two groups if I gave this command imediately
after stopping them. It will start only one group.
I'm working on Linux RedHat 9 MySQL 4.0.14.
How can I solve this problem.

Linux And MySQL Access
I know MySQL account has nothing to do with Linux system account.

I just wondering is there a way when I creates a new Linux account it will automatically creates a MySQL database account?

Or do I have to write my own shell script to do that?

Access Linux Mysql Server From Windows?
Can I run a Mysql server on a linux box, and access the databases belonging to it over a lan from a machine running windows xp?

Charset Collate Problem In Java Program Using Java.sql
I defined one field in one table with a special charset collate setting:

`name` text character set ascii collate ascii_bin NOT NULL

I wrote a Java program use java.sql to retrieve data from the 'name' field.

But the statement:

name = rs.getString("name");

returned some garbage like "[Gasfaf", though the expected return result should be something like "Jen".

Mysql On SMP CPU Under RedHat
I have a 2xPIV Xeon box under RedHat 8 system and want to use mysql 4.0.14. How I should setting mysql for best perfomance ?

Mysql For Redhat 9
im planning to have a mysql server in redhat 9. my question is from the list on the download page of mysql, what should i download? there seem to be so many mysql for linux and i cant find the one for redhat 9.

Mysql On SMP CPU Under RedHat
I have a 2xPIV Xeon box under RedHat 8 system and want to use mysql 4.0.14. How I should setting mysql for best perfomance ?

RedHat 8 And MySQL
I recently ran across an interesting problem, and I'm curious as to whether any of you out there have had the same problem.

A friend of mine was trying to get his MySQL server running on RedHat, and was having a difficult time. He could not connect from his windows workstation. After a short look at his user table, I could see it was set up to only allow local connections (an obvious default security measure). This is where it gets wierd.

From a SSH session, I created a super user with full rights to all databases on all hosts (allowed login from any host). But my friend still couldn't connect from his workstation. I finally realized that the mysql daemon is appending '@localhost' on the supplied username no matter what the user supplies. Thus, a non-local connection fails.

Perhaps I'm missing something here...I am obviously not a MySQL expert. But I was able to get my MySQL running very quickly on my Mandrake 9 box. It seems RedHat has made some changes to its distribution of MySQL. I'm not sure what to do next.

MySQL Redhat
I have installed MySQL 3.53 on two RH7.3 and one RH9.0 boxes.
On one of the 7.3 and the 9.0 box, when I try to connect remotely, it
takes about 45 seconds to connect, whereas the other 7.3 box connects
almost immediately.
The fast box has standard install of 7.3 with tomcat added.
The 9.0 box is straight RH9.0 standard install.
I can't find anything in common between the slow boxes, but not on the
fast one.

RedHat 9.0 MySQL, PHP CREATE
I have a RedHat 9.0 web server setup for intranet use. When the webmaster tries to use his CREATE DATABASE and CREATE TABLE scripts it tells him that he doesn't have the permission to do it. I've given all the necessary permissions to do it, I think. Any suggestions?

MySQL As Part Of RedHat 9 Install
When I did my RedHat9 install, I choose Workstation and customized the
packages I wanted install. As a part of that customization, I chose
mySQL DB; however, I can't seem to find any RedHat documentation that
says how to get to these installed packages. I would like to just start
using them, but not sure where to start. Any hints to get up and going
quickly?

Problem Installing MySQL Max Rpm On RedHat 9
SELECT *
FROM Distance, LorryDetails
WHERE cavan = (Select min (cavan) From Distance where cavan>0);

here is the results i am getting

source ,Cavan, Athlone, Cork, Galway ,LorryID, LorryReg, Position
Athlone 90 0 180 80 3 02-CN-8001 Cork
Athlone 90 0 180 80 7 00-CN-1000 Cavan
Athlone 90 0 180 80 10 02-G-8001 Galway
What i want to try and do is compare the Values with the Column names and get the shortest path. for example when you compare the position cort with the column cork it is 180, cavan is 90, and galway is 80. Galway is the nearest to athlone so i want to narrow down the results to just give me back the row where the position is equal to Galway.

Installing Mysql-administrator On Redhat
I am unable to install mysql-administrator on Redhat AS 4.

#rpm -i mysql-administrator-1.1.6-1.i386.rpm
erreur: Dépendances requises:
libstdc++.so.6(GLIBCXX_3.4.4) est nécessaire pour
mysql-administrator-1.1.6-1.i386

But I already have the library:
#ls -l /usr/lib/libstdc++.so.6
lrwxrwxrwx 1 root root 18 nov 16 17:27 /usr/lib/libstdc++.so.6 ->
libstdc++.so.6.0.3

Anybody have had such installation problem?

MySQL Redhat Slow Responding To Connections
I have installed MySQL 3.53 on two RH7.3 and one RH9.0 boxes.
On one of the 7.3 and the 9.0 box, when I try to connect remotely, it
takes about 45 seconds to connect, whereas the other 7.3 box connects
almost immediately.

The fast box has standard install of 7.3 with tomcat added.
The 9.0 box is straight RH9.0 standard install.

I can't find anything in common between the slow boxes, but not on the
fast one.

Queue Size Affect MySQL On RedHat
i want to know if the system parameter somaxconn affect the capabalities
of MySQL to maintain more than five thousands of HTTP connections ?

How Listen Queue Size Affect MySQL On RedHat
i want to know if the system parameter somaxconn affect the capabalities
of MySQL to maintain more than five thousands of HTTP connections ?

Mysql And Java
I am using MySQL as a database and am trying to run a sample program to fetch and display data from a table...and dispaly like panel in database
.Please give me the sample code for that .ITs very urgent .I cannot complete my project until ur reply

Example Of Java Using Mysql
i have development experience with other languages and rdbms. now i am trying to learn java as well as mysql. can anyone share a simple java app that accesses a mysql table? or point me to any web resources that might have such a working example? i would like to see how one accesses a table stored in a local database.

Java API To MySQL
--0-413911351-1058468110=:5477
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I want to know if there is java API to mySQL like its available for C and C++.

MySQL-- Java
I want to make a java-frontend for adding data to a mysql db, have anyone done this?
If so, how?

MySQL + Java
Basically i want a GUI frontend to connect to a database. My experience of this has been visual basic app and access database. The only thing i liked was that to deploy the user only needed the app and the database, deployment was simply packaging the 2 together.Can i make a database using mySQL and deploy it as in the example above? Or does the user need to have a mySQL installed ? Now i all read about databases mySQL/oracle is of a server running the database and the app connecting. However for my app the information will not be updated or changed and therefore i don't need to connect to a server to access the database?

MySQL -- Java Vs PHP
Does Java work better than PHP with MySQL? What are pros and cons of using
Java or PHP? I am concerned Java may be slower than PHP with MySQL.
Can someone share the experience or point me to some good white papers or
benchmarks?

Communicating With MySQL Through Java
In java is it possible for me to open a socket with a MySQL database and directly send infomation or would I need to use something like php as a buffer.

I know this isn't secure, but the application I am writing does not neet security. I'm just looking for some method to add information to a database. I made a simple .jar file mhich can do what I am looking for but I now I need something which I can upload to a remote webserver.

Transactions With Java And MySQL
I'm trying to port the use of postgresql db to mysql. I'm using
Java and having the following problem - I can't seem to write more
than 1 query per execution. Easier to explain with an example that
worked under postgresql and does not using mysql:

aStatement.executeQuery("BEGIN; DELETE FROM table1; DELETE FROM
table1; DELETE FROM table3; COMMIT;");

If I separate this into 5 different queries it works fine... Any
ideas??

Transactions With Java And MySQL
I'm trying to port the use of postgresql db to mysql. I'm using
Java and having the following problem - I can't seem to write more
than 1 query per execution. Easier to explain with an example that
worked under postgresql and does not using mysql:

aStatement.executeQuery("BEGIN; DELETE FROM table1; DELETE FROM
table1; DELETE FROM table3; COMMIT;");

If I separate this into 5 different queries it works fine... Any
ideas??

Connecting To MYSQL From JAVA
i need to connect to a MYSQL database from a JSP... so i believe that if i learn how to connect to the MYSQL database through java... i can use the same method to connect through a JSP... anyways my question is does anyone know how to connect to mysql through java.

Mysql Connector Java JAR
I am making a Java Applet connects to mysql database, it works well in
application mode. When I run it in applet mode, obviously the client
running the applet should have the mysql connector file
(mysql-connector-java-3.0.8-stable-bin.jar).

So the question is how to bundle this mysql jar file with my applet jar
file. I've tried to make both 2 files together in the html file:

archive="PCMApplet.jar;mysql-connector-java-3.0.8-stable-bin.jar"

the GUI shows up but the connection call to database is failed:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
It seems to me that the mysql-blah.jar is not being used.

Connection Between Mysql And Java
I have a big problem, that is that in mysql, I send a Timestate data, and when I try to get it with java, I can't save it into any variable, neither string or Timestamp,

Java To MySQL Connection
I have Data in my MySQL DB. and I wont to use my java class to pull out information from my DB.
my class is this and I wont to add the code in the ***'s
public void getComunicate()
{
url = "jdbc:******:test";

try{
Class.forName("********".Driver");
con = DriverManager.getConnection(url, "MySQL", "1234");
}catch (java.sql.SQLException ex){
System.err.println("SQLException: " + ex.getMessage());

}catch (java.lang.ClassNotFoundException ex){
System.err.println("class not found: " + ex.getMessage());

Mysql-connector-java-3.1.13-bin
I've MYSQL 5 installed and I want to connect to MYSQL using BIE JBOSS . I had put the jar file mysql-connector-java-3.1.13-bin.jar in the deploy/jboss/bie.sar folder and in windows environment I was able to connect to the MYSQL DB. But when I try doing the same in LINUX environment , I get the following error ,

Could not create connection; - nested throwable: (java.sql.SQLException: Cannot connect to MySQL server on <IP>:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.NoRouteToHostException)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Cannot connect to MySQL server on <IP>:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.NoRouteToHostException)))


Problem With MySql And Java Under Windows
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import com.mysql.management.driverlaunched.ServerLauncherSocketFactory;

public class ConnectorMXJTestExample {
public static void main(String[] args) throws Exception {
String hostColonPort = "localhost:3306";

String driver = com.mysql.jdbc.Driver.class.getName();
String url = "jdbc:mysql://" + hostColonPort + "/" + "?"
+ "socketFactory="
+ ServerLauncherSocketFactory.class.getName();
String userName = "root";
String password = "";

Class.forName(driver);..................................................

How To Ship Mysql Connector Java JAR
I am making a Java Applet connects to mysql database, it works well in
application mode. When I run it in applet mode, obviously the client
running the applet should have the mysql connector file
(mysql-connector-java-3.0.8-stable-bin.jar).

So the question is how to bundle this mysql jar file with my applet jar
file. I've tried to make both 2 files together in the html file:

archive="PCMApplet.jar;mysql-connector-java-3.0.8-stable-bin.jar"

the GUI shows up but the connection call to database is failed:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

It seems to me that the mysql-blah.jar is not being used.

Deleting Mysql Entries In Java
I am asking the user to put in a number and the java prog will look for the corresponding entry and delete it.

so far i have asked the user and stored their choice and now move onto the part of deleting the entry.

i need to call the method for deleting and pass the parameter of the user´s entered number to it.

if im taking the right approach or if "DAO" patterns would be more useful?

Ship Mysql Connector Java JAR
I am making a Java Applet connects to mysql database, it works well in
application mode. When I run it in applet mode, obviously the client
running the applet should have the mysql connector file
(mysql-connector-java-3.0.8-stable-bin.jar).

So the question is how to bundle this mysql jar file with my applet jar
file. I've tried to make both 2 files together in the html file:

archive="PCMApplet.jar;mysql-connector-java-3.0.8-stable-bin.jar"

the GUI shows up but the connection call to database is failed:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

It seems to me that the mysql-blah.jar is not being used.

Difficulty Connecting To Mysql Database From Java
Unable to connect to any hosts due to exception:

java.security.AccessControlException: access denied
(java.net.SocketPermission localhost resolve)

What is causing this error? is it a MYSQL or JAVA/JSP Problem, i cant
seem to work this out ?

Java Mysql Show Table Status
I am using java to retrieve a resultset with "show table status" mysql
command. I am having problem reading the [name] and [engine] column.
In the metadata object it is showing as VARCHAR but when I do
getString() it is returning me the object string (e.g. "[B@1e3e7d2")and
not the actual database value. I am using Mysql 4.1 and jdbc driver
3.1. I tried getB/Clob, getBytes, getCharacterStream() and none of
them is working.

Where To Get My SQL For Redhat 9
where can I get a free copy of My SQL. I'm running Redhat 9.0 on my
laptop. I looked at www.mysql.com but was a bit confused as to which
package I need to download.

The Problem Is About Access Denied For User...how Can I Access The Mysql??
you can find some problems below. the problem is about access denied for user...
how can I access the mysql? ......

Thread_stack On Redhat 8.0
I saw this section in mysql manual.

"If you are using Red Hat 8.0 or a new glibc 2.2.x library, you should start mysqld with
the option --thread-stack=192K. (Use -O thread_stack=192K before MySQL 4.) If you
don’t do this, mysqld will die in gethostbyaddr() because the new glibc library requires
a stack size greater than 128K for this call. This stack size is now the default on MySQL

4.0.10 and above."

I am using red hat 8.0. Mysql is started automatically when my machine is started. How should I set this variable. Can I add this to my.cnf file and restart mysql. If so how should(format) I add it to the my.cnf file.

Replication Error On RedHat AS 4 ( 5.0.33)
I download the newer MySQL version 5.0.33. And i compile it for multi-threads support on my 64 bit Redhat AS 4 running on DELL 2950. Everything is fine while installation time.

But error occues when another slave MySQL contact this new MySQL version master. After trying, I found out some kind of error "ONLY" happen on 64 bit RedHat AS4 and running with mult-threads MySQL.

I wound not wanna downgrade my 64 RH4 AS to 32. Although "Non-Multi-thread" MySQL can well run on my 64 bit RH4 AS, multi-threads MySQL still my prefer if it can work out.

Installation Problems On RedHat EL4 On Ia64
I'm running RedHat EL4 on an ia64 system. I've been using
PostgreSQL for a while but I now have an app that I think
requires MySQL so I wanted to try it out.

I tried installing MySQL-server-standard-5.0.18-0.rhel4.ia64.rpm
and I get an error that it conflicts with mysql-4.1.7-5.RHEL4.1,
so apparently I've already got MySQL 4.1.7 on the system.

I want use PHP with MySQL, which means I have to configure PHP and
tell it where the MySQL headers are. But I don't seem to have
headers, at least not that I can find.

I tried uninstalling MySQL 4.1.7 first but it says that dovecot and
perl depend on it. I tried installing the "headers" rpm for 4.1
but the only one I found was 4.1.18 and rpm says it conflicts with
mysql-4.1.7-5.RHEL4.1.

So, any suggestions? I don't think I'm currently using MySQL for
anything, but I don't want to break perl. I'd like to get 5.0
running. I just don't know enough about Linux and RPMs to be
confident that I can uninstall 4.1 and install 5.0 without screwing
something up.

MySQL V4.0 -> Red Hat Linux 9
I'm having great problems trying to install the latest MySQl RPM
package onto my Red Hat Linux OS.

There is already MySQL v 3.0 pre-installed with the RH Linux
distribution disk but I can not seem to get any of the functions
working on it. So I have now dopwnloaded the latest version hoping
that this will fix the error.

I have managed to install the MySQL-shared-compat-4.0.1-0.i386.rpm but
i'm getting the following error message when I install
MySQL-server-4.0.1-0.i386.rpm : Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved