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
Related Forum Messages:
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?
View Replies !
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!
View Replies !
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?
View Replies !
Mysql Access Yellow Dog Linux
i have a problem similar to others in this group but this is a little bit different. i am running mysql on my yellow dog linux server, but for some reason whenever i try to connect, it gives this error: [root@powerpig root]# telnet localhost 3306 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. NHost 'localhost.localdomain' is not allowed to connect to this MySQL serverConnection closed by foreign host. [root@powerpig root]# .
View Replies !
Access Slaved Hard Drive In RH Linux
I have a MySQL db on a RH Linux hard drive that will not boot...I slaved it onto another Linux box and need to pull up the db in the slaved drive... I do see the second hd as hdc1 in GNOME but can not open it?? I REALLY do need to get/copy the db and load into another working box.
View Replies !
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.
View Replies !
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.
View Replies !
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.
View Replies !
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?
View Replies !
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?
View Replies !
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?
View Replies !
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++.
View Replies !
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?
View Replies !
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?
View Replies !
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.
View Replies !
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
View Replies !
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.
View Replies !
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?
View Replies !
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.
View Replies !
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());
View Replies !
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.
View Replies !
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)))
View Replies !
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.
View Replies !
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.
View Replies !
Connect To Mysql Server Using Java
i am trying to connect to mysql server running on different machine,from a java program. i am successful with mysql3.0. but with mysql5.0 -alpha i am getting the error like this..java.sql.SQLException: Server configuration denies access to data source.
View Replies !
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);..................................................
View Replies !
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?
View Replies !
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.
View Replies !
Connecting Java With MYSQL In Wamp Server
import java.sql.*; public class Connect { public static void main (String[] args) { Connection conn = null; try { String userName = "root"; String password = ""; String url = "jdbc:mysql://localhost/test"; Class.forName ("com.mysql.jdbc.Driver").newInstance (); conn = DriverManager.getConnection (url, userName, password); System.out.println ("Database connection established"); } catch (Exception e) { System.err.println ("Cannot connect to database server"); e.printStackTrace(); } finally { if (conn != null) { try { conn.close (); System.out.println ("Database connection terminated"); } catch (Exception e) { /* ignore close errors */ } } } } } I have doubt that it is happening since MySQL is in C:wampMySQl.?? This is the output of StackTrace(); java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at Connect.main(Connect.java:14)
View Replies !
Connecting To A Remote Mysql Server From A Java Application On Another Machine
i've a java application on a (remote/network) machine and mysql running on my local pc.other users who have access to that remote machine must be able to run that java application which will have to get data/send data to the server(/DB) on my local PC. i was able to run the application when its on my local pC using localhost in the connection string. But, now how do i set the connection string so that the java application accesses the DB (/server) from my local PC?
View Replies !
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.
View Replies !
What Shoud Be Version On Redhat 7.3
I have installed as OS (Operating System) Linux Red Hat 7.3. My issue is that I don't know what kind of MySQL should I download to install on it. Would you tell me what version from Community > Downloads > MySQL Community Server > 5.0 ,I must to download ?
View Replies !
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.
View Replies !
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.
View Replies !
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:
View Replies !
Mysql On Linux
I am interested in connecting to my MySql database that is running (default install) on FC4. I want to connect to the db with my Windoze machine using MySql Query Browser. Both machines are behind a router; the gateway is 192.168.0.1. The Linux ip address is 192.168.0.50 and the windows is 192.168.0.11 (both static). I guess I need to learn how to determine the mysql host and port when connecting. I thought it would just be 192.168.0.50 and 3306 respectively, it's not working.
View Replies !
MySQL And Linux
I am pretty new to the MySQL/Linux worlds. Each time I want to use MySQL, I have to start the program under the root account. Are users other than "root" allowed to access the program? If so, how is it done? It would be nice if I didn't have to continuously log into root every time I would like to use MySQL.
View Replies !
|