db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey W. Bullard" <jeffrey.bull...@nist.gov>
Subject newbie can't connect to/export from MySQL with ant task
Date Wed, 13 Jan 2010 19:20:32 GMT
Hi,

I'm trying to export a MySQL database using DdlUtils.  I went through  
a tutorial (http://db.apache.org/derby/integrate/db_ddlutils.html)  
that showed how to export a derby DB and I'm trying to modify the  
build.xml file to do the same thing for a MySQL database on my local  
machine.  The build.xml file is copied below.

When I run "ant export-source-db", I get the following error:

BUILD FAILED
build.xml:16: Could not read the schema from the specified database:  
Could not get a connection from the datasource

I have no doubt that my line 16 is wrong, but I cannot find any  
information about the correct format for connecting to a MySQL  
database.  The full path to the database on my machine is /usr/local/ 
mysql/data/vcctl_user

Other information:  My mysql server is definitely running on the  
machine, and the vcctl_user database can be accessed from within  
mysql from the command line (show tables, etc.).

Thanks in advance for any help about how I can properly connect to  
MySQL database.

<?xml version="1.0"?>
<project name="MigrateToDerby" basedir=".">

    <path id="classpath">
       <fileset dir="./lib">
          <include name="**/*.jar"/>
       </fileset>
    </path>

    <target name="export-source-db" description="Dumps db structure  
and data">
       <taskdef name="databaseToDdl"
               classname="org.apache.ddlutils.task.DatabaseToDdlTask">
          <classpath refid="classpath"/>
       </taskdef>

       <databaseToDdl modelName="MigrateTest">
           <database url="jdbc:mysql://localhost:3306/vcctl_user"
                  driverClassName="com.mysql.jdbc.Driver"
                  username="root"
                  password="vcctl7"/>

          <writeSchemaToFile outputFile="db-schema.xml"/>
          <writeDataToFile outputFile="data.xml"/>
       </databaseToDdl>

    </target>
</project>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message