cannot install mysql-connector-java, no package available - mysql

I need to install JDBC for MySQL running in CentOS.
I tried using this command
yum install mysql-connector-java
but it says
No Package mysql-connector-java available
Nothing to do
Do you know any other command that aims to install JDBC?

Here's what I did to solve the issue:
Download the JDBC here
Extract the files anywhere you want. To extract follow the command below
tar -zxvf [TAR FILENAME]
You will find mysql-connector-java-5.1.22-bin.jar inside that folder. Copy that and paste to (in my case) /%android-sdk%/tools/lib
Add the new location of mysql-connector-java-5.1.22-bin.jar to classpath

mysql java connector is platform independent. you can download it from following link
http://dev.mysql.com/downloads/connector/j/
you can put jar file in /lib/ or /webapps//web-inf/libs
I am assuming that you are using tomcat.
Thank you

Related

How to install Google Apis Drive v3 via command line on Ubuntu-18.04

I have been trying to install Install-Package Google.Apis.Drive.v3 using this source with the difference that I have Ubuntu-18.04 instead of Windows.
I know it may be a simple question but I have been trying research how to do that from this morning. I installed sudo apt install nuget on my machine and have been trying to add packages or as in this case the Google.Apis.Drive.v3 package but no luck.
I went through this source which was useful, but does not carry information I was able to replicate on my Linux machine.
Also this source, this one and this one too. But also this last one is for Windows and was not very useful.
How do I install Google Apis Drive V3 via command line easily as it is documented for windows but on Ubunbtu-18.04?
Thanks for pointing to the right direction for solving this problem.
Solution
The way you install your Drive API's library is depending on the programming language you are aiming to use. These are the following commands to run depending on the different languages to interact with the API (with their respective links to the source of the setup):
Python:
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
C#/.NET:
Create a new Visual C# Console Application project in Visual Studio.
Open the NuGet Package Manager Console, select the package source nuget.org, and run the following command:
">Install-Package Google.Apis.Drive.v3
Java:
gradle init --type basic
mkdir -p src/main/java src/main/resources
Node.js:
npm install googleapis#39 --save
For the Browser check out the steps to follow here
I hope this has helped you. Let me know if you need anything else or if you did not understood something.
NOTE: For all Ubuntu-18.04 users that wish to install via command line the correct way is: sudo dotnet add package Google.Apis.Drive.v3

unable to use javapackager command

I am using ubuntu 16.04, and my java is in /usr/bin/java
and jdk is in /usr/lib/jvm/java-8-openjdk-amd64 . non of these had the javapackager inside.
I am not able to use javapackager command and do not know how to configure it to use in command-line.
Can anyone help me?
Thanks.
It seems javapackager comes with a package called openjfx,
so running apt install openjfx should make the tool available for you, among your other java tools.
$ apt-file search javapackager
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/bin/javapackager
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8/man1/javapackager.1.gz
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javapackager.1.gz
You should define your java path.
You can set your JAVA_HOME in /etc/profile as Petronilla Escarabajo suggests. But the preferred location for JAVA_HOME or any system variable is /etc/environment.
Open /etc/environment in any text editor like nano or gedit and add the following
JAVA_HOME="/usr/lib/jvm/open-jdk" (java path could be different)
Use source to load the variables, by running this command:
source /etc/environment
Then check the variable, by running this command:
echo $JAVA_HOME

Where is the MySQL JDBC jar file in Ubuntu?

I have installed MySQL 5.5.32 via apt-get install into Ubuntu 13.04.I want to use it in a Java project.For this i must have MySql connector jar.I can not find it.I tried locate *mysql*.jar but it did not find anything.I looked into /etc/mysql but there is no jar in it.I don't want to download it from internet because i believe that it somehow exists in an MySQL folder.Does anybody have any idea where the connector jar went into Ubuntu 13.04?
If you're using a version of Ubuntu prior to 19.04, you'll need to install libmysql-java, the MySQL JDBC driver, because the connector is not in the Ubuntu-packaged MySQL package that you've already installed. Versions after that do not publish that package.
Once it's installed, you'll have the file /usr/share/java/mysql.jar, which is an indirect symlink to the actual jar file.
Alternatively, install the mysql-apt-config package, update, and you'll be able to install all currently supported MySQL software with apt.
First, apt-get install libmysql-java
Then mysql.jar is located in /usr/share/java/mysql.jar.
Third, in Eclipse, do this as: Project -> Properties -> Java Build Path -> Libraries -> Add External JARs -> select /usr/share/java/mysql.jar
In ubuntu 19.10 the following works:
apt-get install libmariadb-java

Installing behat with mink on windows using composer

I am trying to install mink/behat on windows machine using composer by following the help given on behat page. http://docs.behat.org/cookbook/behat_and_mink.html.
But when I run
php composer.phar install
then I get the error
But I have composer.json(exactly same as described in behat page) file in mentioned directory. Can someone please guide me how can I install it. Thanks
Composer installs packages on project-base. I don't think you have a PHP project inside C:\Windows\system32...
Navigate to your project by using cd (change dir) and be sure the composer.phar file is automatically loaded in every directory (see this answer).
Then create a composer.json file in which you put the things that is stated in the docs.
After that run composer install (or php composer.phar install, depends on which install method you used).

Mysql: How to see the compile time configs of a mysql binary

I installed mysql using apt-get on my local machine recently.
It proceeded with the default my.cnf.
I would like to see what are the compile time configurations of this binary.
Can some one help me how can i do this?
install mysql-server source.
apt-get source mysql-server # root access not needed
This will create some archive files in the current directory. In my debian lenny it creates the following directories. In your Ubuntu it'll be almost same.
mysql-dfsg-5.0-5.0.51a
mysql-dfsg-5.0_5.0.51a-24+lenny5.diff.gz
mysql-dfsg-5.0_5.0.51a-24+lenny5.dsc
mysql-dfsg-5.0_5.0.51a.orig.tar.gz
Now inspect the debian/rules file in extracted source. I did it by this,
less mysql-dfsg-5.0-5.0.51a/debian/rules
You can use other editor (nano, vi, gedit all are okay). Arround line 68 you'll see the configuration option
To know more about how to recompile a debian source package, read
Howto recompile debian packages
Compiling Debian or Ubuntu Source Packages
Try to use this:
shell> mysql_config
grep CONFIG $(which mysqlbug)
Source