LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-14-2012, 03:25 AM   #1
conflicker
Member
 
Registered: Sep 2011
Posts: 89

Rep: Reputation: Disabled
installing mysql connector java in centos.


any idea on how to install mysql connector java in centos? your is much appreciated. Thanks.
 
Old 04-14-2012, 04:16 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,598

Rep: Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531
Hi,

You can use your package manager:
Code:
yum install mysql-connector-java
Regards
 
Old 04-14-2012, 04:19 AM   #3
conflicker
Member
 
Registered: Sep 2011
Posts: 89

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Hi,

You can use your package manager:
Code:
yum install mysql-connector-java
Regards
I already tried that command and I thought is not the right way to install mysql connector for java.
It gave me this error after executing the command:
Quote:
No package mysql-connector-java available.
Error: Nothing to do
 
Old 04-14-2012, 04:42 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,598

Rep: Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531
For Centos6 see this, or this for the 64bit distro.

For older Centos you need to use the epel repo.
 
Old 04-14-2012, 05:01 AM   #5
conflicker
Member
 
Registered: Sep 2011
Posts: 89

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
For Centos6 see this, or this for the 64bit distro.

For older Centos you need to use the epel repo.
Hi bathory I really appreciate your help, but I'am novice in linux stuff and I don't know the terms like distro or repo. And base on you link, I can't find any command to be executed to install the connector. Can you explain to me this stuff and their purpose.

Hope you can help me learning this thing by starting here...

Thank you so much.
 
Old 04-14-2012, 05:20 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,598

Rep: Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531
Well, you didn't say your centos version.
For centos6 you can download the appropriate rpm from the links above and use rpm to install it:
Code:
rpm -ivh mysql-connector-java.x.y.z.rpm
Also at http://rpm.pbone.net you can search for the package you want for centos5/rhel5 and use the same method to install it, if you don't want to mess with different repositories.
BTW distro is the distribution name, and repo is the repository where you can find and install packages.
 
Old 04-14-2012, 05:30 AM   #7
conflicker
Member
 
Registered: Sep 2011
Posts: 89

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Well, you didn't say your centos version.
For centos6 you can download the appropriate rpm from the links above and use rpm to install it:
Code:
rpm -ivh mysql-connector-java.x.y.z.rpm
Also at http://rpm.pbone.net you can search for the package you want for centos5/rhel5 and use the same method to install it, if you don't want to mess with different repositories.
BTW distro is the distribution name, and repo is the repository where you can find and install packages.
I got this error after executing the command:

Quote:
error: Failed dependencies:
java-gcj-compat >= 1.0.31 is needed by mysql-connector-java-1:5.1.12-2.el6.i686
jta >= 1.0 is needed by mysql-connector-java-1:5.1.12-2.el6.i686
log4j is needed by mysql-connector-java-1:5.1.12-2.el6.i686
Does it says that I'm using the wrong rmp file?
 
Old 04-14-2012, 06:03 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
No it does not say you are using wrong rpm but it says that you need those packages installed before you can install mysql connector for java. I would suggest you list the output of lsb_release -a command here in Code tags. This will help find your distribution version and platform.
 
Old 04-14-2012, 06:19 AM   #9
conflicker
Member
 
Registered: Sep 2011
Posts: 89

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linuxlover.chaitanya View Post
No it does not say you are using wrong rpm but it says that you need those packages installed before you can install mysql connector for java. I would suggest you list the output of lsb_release -a command here in Code tags. This will help find your distribution version and platform.
is there any alternate command of lsb_release.. cause the command is not found in my server.
 
Old 04-14-2012, 06:29 AM   #10
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
If you are using Cent OS, then there should be a file in /etc folder called something like redhat-release or something. cat the output of the file here to more about your distribution and version. Knowing these details would help us help you.
 
Old 04-14-2012, 06:32 AM   #11
conflicker
Member
 
Registered: Sep 2011
Posts: 89

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linuxlover.chaitanya View Post
If you are using Cent OS, then there should be a file in /etc folder called something like redhat-release or something. cat the output of the file here to more about your distribution and version. Knowing these details would help us help you.
This is the output:
Quote:
CentOS release 6.2 (Final)
 
Old 04-14-2012, 09:35 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,598

Rep: Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531
Quote:
I got this error after executing the command:

error: Failed dependencies:
java-gcj-compat >= 1.0.31 is needed by mysql-connector-java-1:5.1.12-2.el6.i686
jta >= 1.0 is needed by mysql-connector-java-1:5.1.12-2.el6.i686
log4j is needed by mysql-connector-java-1:5.1.12-2.el6.i686
Does it says that I'm using the wrong rmp file?
It says that you miss those 3 dependencies. That's why it's always good to use yum to install packages, as it can resolve dependencies and install them too.
In the same page, there are links to the 3 packages above, but you may come into more dependencies trying to install them.

You can try to download the connector from mysql in binary format. After extracting the archive, you can copy manually mysql-connector-java-5.1.19-bin.jar into the /usr/share/tomcat6/lib directory (I guess you use tomcat6)

Regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
java cannot find mysql connector jordanwb Programming 25 06-14-2011 11:07 AM
install mysql-connector-java redhat sssl Linux - Newbie 1 05-01-2009 09:38 PM
mysql java connector cuk Slackware 4 06-01-2008 11:48 AM
Mysql and mysql java connector, connection refused arubin Slackware 3 03-29-2008 02:41 AM
JDBC connection, mysql-connector-java fhleung Programming 4 08-16-2007 01:49 AM


All times are GMT -5. The time now is 07:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration