db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: newbie can't connect to/export from MySQL with ant task
Date Wed, 13 Jan 2010 20:48:35 GMT
Since Ddlutils doesn't do anything unusual as far as JDBC is
concerned, could you try to connect with that connection information
and the same driver jar, e.g. by using SquirrelSQL or something
similar (but Java/JDBC based) ?

Tom

On Wed, Jan 13, 2010 at 12:45, Jeffrey W. Bullard
<jeffrey.bullard@nist.gov> wrote:
> I added the verbosity parameter to the task like this in the build.xml file:
>
> <databaseToDdl modelName="MigrateTest" verbosity="debug">
>    <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>
>
> but the output to stdout is exactly the same as before.  Is there a log file
> somewhere that I should be checking?
>
> Jeff
>
> On Jan 13, 2010, at 3:29 PM, Thomas Dudziak wrote:
>
>> Could you increase the verbosity of the task (see
>>
>> http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.DatabaseToDdlTask.html)
>> to debug to get more detail logging, and post that here ?
>>
>> Tom
>>
>> On Wed, Jan 13, 2010 at 11:20, Jeffrey W. Bullard
>> <jeffrey.bullard@nist.gov> wrote:
>>>
>>> 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
View raw message