Saturday, February 17, 2007

How to setup JUDDI and MySql

1. Copy MySql driver to correct path, for example mysql-connector-java-5.0.4-bin.jar to <tomcat-path>/common/lib

2. Create context.xml file and copy to
<tomcat-path>/webapps/juddi/META-INF
<Context path="juddi" docBase="juddi" debug="5" reloadable="true" crossContext="true">
<Resource name="jdbc/juddiDB" auth="Container" type="javax.sql.DataSource"
username="<your-db-user>" password="<your-passwd>" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/juddi?autoReconnect=true"
validationQuery="select count(*) from PUBLISHER" />
</Context>

3. Execute crearte_database.sql (a given file in JUDDI package at sql/mysql subdirectory).

4. Change insert_publisher.sql (the path is the same as step 3):
INSERT INTO PUBLISHER (PUBLISHER_ID, PUBLISHER_NAME, EMAIL_ADDRESS, IS_ENABLED, IS_ADMIN)
VALUES ('<your-db-user>', '<your name>', '<your email>', 'true', 'true');

5. Adding your-db-user in MySql:
GRANT ALL PRIVILEGES ON *.* TO '<your-db-user>'@'localhost' IDENTIFIED BY '<your-passwd>' WITH GRANT OPTION;

No comments: