how to connect mysql databases in weka? - mysql

i want to use my mysql databases in weka in order to analysis data.
i download the mysql-connector-java-5.0.8-bin.jar and put that in weka folder in my program Files folder, and add this path to system variable path, but when i open the weka explorer and click the openDB, i don't know what should i write in the url textbox,
i don't know completely what should i do?
the error that i saw is:
problem connecting to database:
no suitable driver found for!
please give me a total guidance, thanks in advance.

add mysql-connector-java-5.1.12-bin.jar to CLASSPATH .
or put it in weka folder, navigate to weka installation folder and run command :
%java_home%/bin/java -Xmx300M -cp ".;weka.jar;mysql-connector-java-5.1.12-bin.jar;" weka.gui.GUIChooser
then click open DB and
fill in the proper user+password
put the url: jdbc:mysql://localhost:3306/DATABASENAME
Click Execute. The result window should show the results now.

For Weka 3.7.10, the classpath system environment variable is not took into account (at leat under Windows 7). The only working approach for me was to modify the RunWeka.ini file from the Weka installation folder as follows: the cp= setting was modified to:
cp=%CLASSPATH%;d:/Programs/jdbc/mysql-connector-java-5.1.26/mysql-connector-java-5.1.26-bin.jar
whereas only the %CLASSPATH%; setting was originally provided. Does not make much sense, but in worked.

find some introduction to WEKA and the environment variable:
http://weka.wikispaces.com/CLASSPATH

Copy mysql-connector-java-X.X.XX-bin.jar to /usr/share/java/
unizip /usr/share/java/weka.jar
edit: /usr/share/java/weka/experiment/DatabaseUtils.props
add:
jdbcDriver=com.mysql.jdbc.Driver
jdbcURL=jdbc:mysql://localhost:3306/test (with your server)
add shell
export CLASSPATH=/usr/share/java/mysql-connector-java-X.X.XX-bin.jar:
export CP=/usr/share/java/mysql-connector-java-X.X.XX-bin.jar::/usr/share/java/:/usr/shared/java/weka.jar
execute weka:
java -cp $CP -Xmx500m weka.gui.explorer.Explorer
Ready

Related

IntelliJ IDEA: Unable to download MySqlDriver

I am using IntelliJ IDEA,and I want to configure MySQL database from the IDE:
then fail:
The error is:
Failed to download 'http://download.jetbrains.com/idea/jdbc-drivers/mysql-connector-java-5.1.40-bin.jar
I don't know why connection will time out.
I can download other things such as plugins from jetbrains, but except jdbc-drivers.
I recommend taking a look in IDEA's log files to see if they may have additional details as to why the download is timing out. From the menu go to Help > Show log.
As a workaround, you can manually download the drivers and place them in the necessary location. Download bo the JAR and the mysql-connector-license.txt license file (from http://download.jetbrains.com/idea/jdbc-drivers/mysql-connector-license.txt of from MySQL directly). Place both files in the path {idea-config-dir}/jdbc-drivers/MySQL Connector/J/5.1.40 (modifying the version number if necessary). The location of the {idea-config-dir} can be looked up in the Directories used by the IDE to store settings, caches, plugins and logs help document. For example, c:\Users\Dilbert\.IntelliJIdea2017\config or ~/Library/Preferences/IntelliJIdea2017
Thus, in the end, that directory should have two files:
mysql-connector-java-5.1.40-bin.jar
mysql-connector-license.txt
put jars in
C:\Users\UUSER\AppData\Roaming\JetBrains\DataGrip2020.1\jdbc-drivers\PostgreSQL\42.2.5
from another install with internet
In 2019, The folder is this >>
C:\Users{YourUser}.DataGrip2019.3\config\jdbc-drivers\MySQL Connector\J 8\8.0.21
Download jar from
https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.21/mysql-connector-java-8.0.21.jar

About the mac weka connect to mysql

I have added java-connect-5.1.41.jar to the directory weka-oracle-jvm/content/java, but when I open DB and connect, it returns false and I get the error:
Unable to find a suitable driver to jdbc.
I have change the ./bash_profile:
export CLASSPATH = ".../weka.jar:/.../java-connect-5.1.41.jar"
I don't think you have downloaded the right file. If you're using MySQL, the file that you have to copy should be of the format "mysql-connector-java-version-bin.jar". The download link is here.
I have also posted a full work-around here. Do let me know if it works for you.

FireDac error 314 - but DLLs are in program directory

I am getting when trying to access a MySql database :
[FireDac][Phys][MySQL]-314. Cannot load vendor library [libmysql.dll
or libmysqlld.dll]
This did not previously happen with this (unchanged) code, however, I have upgraded to Windows 10 and had to reinstall Delphi XE8, so it is obviously a system configuration matter.
In order to try to solve the problem, I copied both of those files into c:\windows\sysytem32.
When that did not seem to work, I copied them into \win32\debug, which is where the generated .EXE resides.
I imagine that I am doing something rather stupid, but can't see what.
The proper solution is to place the driver file (eg., libmysql.dll) in your application's folder, or to place the installation location in your FDDrivers.ini file:
[MySQL]
Vendor=<folder>\libmysql.dll
(Recent versions of the documentation seem to use VendorLib instead of Vendor in the INI file.)
See the RAD Studio documentation topics Configuring Drivers (FireDAC) and Connect to MySQL Server (FireDAC) for more information.
Let me to answer in two point.
Developing, live database connection!
Hope you have on your data module an "TFDPhysMySQLDriverLink" component.
Click this component and browse your LibMySQL.DLL into VendorLib. Should be work. But only in design time.
Runtime. Hopefully your DM created firstly in your project.
In the DM's OnCreate event, you have to disconnect your library (I always ran my project with no database connection) and replace your "TFDPhysMySQLDriverLink"'s Vendorlib to LibMySQL.DLL (which is copied your which is copied where the generated .EXE resided)
Have a nice day!

How to add new functionality into ejabberd server

I have created a .erl file named "confirmDelivery.erl" and compile it successfully, A beam file named "confirmDelivery.beam" has been created.
All these files are in /etc/ejabberd/. Now I wanna add the functionality of this file into ejabberd, But I don't know how to link my file with ejabberd server.
Please help me, I will be really really thankful to you.
You need to place your beam files in the path of the Erlang VM to be able to use them. You should have a look at where are other ejabberd module for example and place it in the same directory.
You need to put your beam file in etc/ejjaberd/ebin folder and call it from ejabberd debug mode.
use command:
ejabberdctl debug

Hadoop ConnectException

I recently installed hadoop on my local ubuntu. I have started data-node by invoking bin/start-all.sh script. However when I try to run the word count program
bin/hadoop jar hadoop-examples-1.2.1.jar wordcount /home/USER/Desktop/books /home/USER/Desktop/books-output
I always get a connect exception. The folder 'books' is on my deskop(local filesystem). Any suggestions on how to overcome this?
I have followed every steps in this tutorial. I am not sure how to get rid of that error. All help will be appreciated.
copy your books file into your hdfs
and for the input path argument use hdfs path of your copied book file.
for more detail go through below link.
http://cs.smith.edu/dftwiki/index.php/Hadoop_Tutorial_1_--_Running_WordCount#Basic_Hadoop_Admin_Commands
There is a bit of confusion here, when you run the hadoop ... command then the default filesystem which it uses is the hadoop distributed filesystem hence the files must be located on the hdfs for hadoop to access it.
To copy files from the local filesystem to the hadoop filesystem you have to use the following command
hdfs dfs -copyFromLocal /path/in/local/file/system /destination/on/hdfs
One more thing if you want to run the program from your IDE directly then sometimes you get this issue which can be solved by adding the
core-site.xml and hdfs-site.xml files in the conf variable something like
conf.addResource(new Path("/usr/local/hadoop/etc/hadoop/core-site.xml"));
conf.addResource(new Path("/usr/local/hadoop/etc/hadoop/hdfs-site.xml"));
change the path above to the hdfs-site.xml and core-site.xml to your local path.
So the above arguments can also be provided from the command line by adding them to the classPath with -cp tag.