473,789 Members | 2,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem using 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.g etConnection(ur l);

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.g etConnection(ur l);

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).

Cheers,

Mark
Jul 19 '05 #1
0 2403

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6910
by: Derek Scollon | last post by:
Hope someone can point me in the right direction to fix this one... I'm currently running Apache 2.0.40 and PHP 4.2.2 on a RedHat9 server. I'm needing to update to PHP5 but don't want to change the way the rest of the server is configured. So far I've done the following... 1. Copied the following from phpinfo to get the current configuration... './configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux'...
2
5888
by: bouchia.nazha | last post by:
Hello I have encountered a problem using tomcat, linux and ssl. My problem seem to be a JVM memory deallocation problem on Linux. This is my configuration: OS: Redhat7.2 Tomcat: 4.0 Jdk: 1.3.1_07
0
2384
by: Eric Raymond | last post by:
When installing the rpms (or the tar file) onto Red Hat Enteprise Linux AS Beta 1 (Taroon), we get the follwing error: Installing all prepared tables /usr/bin/mysql_install_db: line 1: 7690 Segmentation fault /usr/sbin/mysqld --bootstrap --skip-grant-tables --basedir=/ --datadir=/var/lib/mysql --skip-innodb --skip-bdb Installation of grant tables failed The log file simply shows a start and a stop of the server.
0
624
by: Gary Cote | last post by:
>Description: I've recently compiled mysql 4.0.14 on redhat 8.0. The installation fails, however, when running mysql_install_db. I've attached a transcript below. I gather from searching the 'net that this isn't an entirely unusual thing to happen, and is likely the result of some misconfiguration on my part, or perhaps a version incompatability with my libc. Unfortunately, I haven't seen any concrete suggestions on how to get past it.
0
2946
by: Steve | last post by:
Hi, Yesterday I signed up for another dedicated linux server with the hosting company I use and I am having problems getting MySQL 4.1.3 working on it. I've tried just about everything I can think of to login via the MySQL client but get a variation of the following error every time: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
14
3553
by: Richard Welty | last post by:
ok, i'm confused. i have two systems. one is redhat 7.1 (a server in colo, reasonably current), the other is 8.0 (my laptop). the server in colo is running postgresql 7.3.2 along with redhat's updated versions of apache and php for 7.1 (the php version is 4.1.2) on this server, php can access postgres without difficulty. my laptop is also running 7.3.2 along with the apache and php that go with RH 8.0. i found a need to bring up...
8
3008
by: Xela | last post by:
Hi A have a very annoying problem. I have written java strored procedures for DB2 v8.1. Their deployement and usage is fine as long as the server is a Windows one. But under Solaris 8 and Linux RH, the call of sqlj.install_jar fails. It correctly create a directiory with the correct schema name, but the jar is not copied in it. The error is "Permission Denied" SQLSTATE 38501 and in the log, we can see that calling sqlejReadJar fails in...
2
1756
by: Pat | last post by:
Hi, I installed Mysql Administrator with file mysql-administrator-1.0.22a-1.rh9.src.rpm from the mysql-site on my RedHat 9.0 computer I did: rpm -Uvh mysql-administrator-1.0.22a-1.rh9.src.rpm After one second, i could see: ##################### 100% and that's it.
12
4609
by: Henryk | last post by:
Hey there, I have some problems with the following code snippet on a Virtex-4 PowerPC with a GCC based compiler char chData; sprintf(&chData, "%+05.0f", -0.038f); --I get "-000" ??? sprintf(&chData, "%+05.0f", -0.380f); --I get "-000" ??? sprintf(&chData, "%+05.0f", -3.800f); --I get "-0004" ok
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4089
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.