I am trying to install Ejabberd with mysql and followed this blog.
https://www.ejabberd.im/Using%20ejabberd%20with%20MySQL%20native%20driver
but I can't find any bean files for MySQL
https://www.ejabberd.im/doc/display/CONTRIBS/Yxa
mysql.beam
mysql_auth.beam
mysql_conn.beam
mysql_recv.beam
I have configured all the other things other than copying bean files.
The documentation you are referring to is obsolete. Use of MySQL with ejabberd is now fully integrated / packaged. If you build from source, you need to pass the proper --enable-mysql option. If using binary installer or packages from ProcessOne, the MySQL driver is already included.
What you need is to load schema into your database and configure "odbc" to use your MySQL database.
Related
I'm trying to write a monitoring plugin for Artifactory using MySQL. The idea is that the plugin will collect some data using the Artifactory public API and some command line utilities, then write that data to a MySQL database to be analysed later. The problem is that the plugin can't find the jdbc driver. I placed the driver JAR in <artifactory-home>/etc/plugins/lib and I'm registering it like so:
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/artifactoryTest', <user>, <pass>, 'com.mysql.jdbc.Driver')
This results in a ClassNotFoundException on com.mysql.jdbc.Driver. It seems the class loader used by Artifactory can't find the JAR.
Is there a way to make this work or am I barking up the wrong tree? I'm aware there may be some database technologies that would be better suited for this purpose but many seem like overkill for such a basic use case and I'd like to keep it as simple as possible.
Turns out this is indeed possible. Artifactory can be configured to use a number of different databases, including MySQL, so I figured there must be a way to use the same driver that Artifactory uses and indeed there is.
In the documentation for setting up Artifactory with MySQL it says:
Download the MySQL JDBC driver (available from the MySQL website)
and copy the mysql-connector-java-.jar file into the server's
shared lib directory. For example $TOMCAT_HOME/lib when installed as
a service or $ARTIFACTORY_HOME/tomcat/lib in the standalone version.
Simply dropping the JDBC driver JAR in the shared lib directory makes it available for use within plugins. I imagine this approach would work for any other JARs too.
I've Kallithea running on my own server with sqlite database. I would like to move all this data to MySQL database instead. On default Kallithea uses sqlite if not any other database is specified. From Kallithea documentation pdf https://media.readthedocs.org/pdf/kallithea/latest/kallithea.pdf they recommend to use https://github.com/shazow/sqlalchemygrate to migrate data from database to another.
I'm installed sqlalchemygrate using Python pip but when I try to migrate there is parts what I don't understand at all. Help menu doesn't not clearly specify how to use migrate command. At least I don't understand it at all. For example when I try to type
grate migrate "sqlite:./kallithea.db" "mysql://kallithea#localhost/kallithea"
I get error saying
ImportError: No module named sqlite
In help menu it says to use
migrate METADATA ENGINE_FROM ENGINE_TO
Migrate schema or data from one engine to another.
And example how to use it
grate migrate model.meta:metadata \
"mysql://foo:bar#localhost/baz" "sqlite:///:memory:" \
What I don't really understand is what is that metadata it needs? And how to specify sqlite .db file for this. And how to migrate data to new kallithea database in mysql with user kallithea which has all privileges to that database.
Not sure about Kallithea but RhodeCode users had a great success using TAPS (https://github.com/ricardochimal/taps) project to migrate they databases to different format.
ImportError: No module named sqlite
You probably need to install sqlite, and pip install sqlite or similar.
Regarding what metadata it needs, it's referring to metadata in the context of SQLAlchemy: http://docs.sqlalchemy.org/en/latest/core/metadata.html
I have a mySQL database on my Windows PC. I'm pretty sure I've found the relevant files, namely the following:
formula.frm
formula.ibd
db.opt
What is the natural way to inspect, edit, and generally play with the contents of these files?
You do not view the binary database files directly. MySQL is a service that you connect to with a client and then perform SQL commands. You will need a client (such as MySQL Workbench) to work with the server.
MySQL Workbench is the GUI tool that allows you to connect to a MySQL database and perform actions on it including querying and creating/modifying the various parts of the database.
MySQL Workbench intro: http://dev.mysql.com/doc/workbench/en/wb-intro.html
Getting started with MySQL: http://dev.mysql.com/doc/refman/5.6/en/tutorial.html
There is also the command-line utility that is included when you install the server. It will be in the BIN folder of the MySQL install directory.
Command-line client info: http://dev.mysql.com/doc/refman/5.1/en/mysql.html
Use a tool like Mysql Workbench to connect to the DB. You do nothing directly to the files. You connect to the service and use the DB.
William, it sounds like your question is "how do I take mysql binary files and turn them into something usable on my machine?". If that's the case, you'll want to first install MySQL on your machine if you haven't already. Then you might have a look here for how to recreate a database from a .ibd file.
I want to create a DSN in Ubuntu Linux 10.10 for a Java application with a MySQL back end.
Sorry if the question is simple but I really need your help.
How can I create it? What are the drivers that are needed to install for the same?
JDBC is the way to go to get database connectivity in a Java application.
You'll need to install a JDBC driver for MySQL, e. g. Connector/J. Installation and usage of Connector/J is documented in the MySQL reference manual.
The format of a connection URL for Connector/J is specifically described in 20.3.4.1. Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J.
Hi I am new to tomcat and mysql.
I have installed Tomcat and mysql in Ubuntu 9.10 and both are working great!!
But now I have task of connecting mysql and tomcat.
I dont have any idea on this. However I looked some manuals but did not find any luck.
Guy, Please give me the step by step procedure on how to connect mysql with tomcat.
btw I have downloaded mysql connector and copied the .jar file to $CATALINA_HOME/lib
What else should I do ?
Thanks!
#at0mzk
This is the steps I followed to install tomcat http://www.linuxnix.com/2010/12/how-to-install-apache-tomcat-on-linuxredhatubuntu.html and I installed mysql server and client using the commands sudo apt-get install mysql-server mysql-client later I downloaded JDBC Driver for MySQL (Connector/J) from http://www.mysql.com/products/connector/ and extrated it and pasted the .jar file in /opt/apache-tomcat-6.0.29/lib ( I dont have $CATALINA_HOME/common/lib) . My questions are 1) Is the connection between tomcat and sql established ? 2) do i need to install mysql-server when I have tomcat server ?
Which manual did you follow when installing? Should follow installation intructions in the Tomcat manual for your version. For example 5.5:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#MySQL_DBCP_Example
note that manual says $CATALINA_HOME/common/lib, not $CATALINA_HOME/lib
"do i need to install mysql-server when I have tomcat server"
Firstly, do you need mysql at all? I have plenty of web apps that use alternative databases, even embedded ones. Mysql is not required to run Tomcat.
"Is the connection between tomcat and sql established"
Secondly, individual web applications can themselves establish a connection to mysql directly.
I don't know much about the process of setting up a Tomcat JNDI data source as at0mzk has pointed out, as I've never done it, but I suspect it is again up to the individual application to seek out that service and connect to the database using it. I can say that you don't necessarily need it though, depending on what your applications' require.