ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From M Damon Hill <hwgwl...@yahoo.com>
Subject Re: perplexing exec mysql problem
Date Thu, 22 May 2003 16:01:30 GMT
Douglas--
 
Thanks for the suggestion, however, still to no avail. Here are my two tasks I am running:
 

<target name="init_db">  
    <exec executable="mysqladmin" output="createDB.output">
         <arg line="-hlocalhost -ufrodo -pring create ${project.db.name}"/>
    </exec>
    <antcall target="test_sql"/> 
</target>

<target name="test_sql">
   <sql driver="org.gjt.mm.mysql.Driver" 
          url="jdbc:mysql://localhost/{$project.db.name}" 
          userid="root" 
          password="" 
          src="${sql.dir}/${sql1}"  
          print="yes" 
          output="sql1.output"/>
</target>

The result from running this init_db target is as follows:

[root@machine]# ant -Dproject.db.name=damon_test init_db
Buildfile: build.xml

init_db:

test_sql:

BUILD FAILED
file:/usr/local/new_project/build.xml:259: java.sql.SQLException: Invalid authorization specification:
Access denied for user: 'root@machine' (Using password: NO)

Total time: 38 seconds
[root@machine]#

See anything that I am missing?? I am sure it is blatantly obvious.

Thanks again for the help and suggestions.

Cheers,
~damon



Douglas Guptill <dguptill@accesswave.ca> wrote:
On Thu, May 22, 2003 at 06:19:28AM -0700, M Damon Hill wrote:
> Antoine--
> 
> Thanks for the tips. I am now using the task however, a little problem with that particular
task and maybe it is rooted in my very little experience with databases in general. However,
here is the situation.
> 
> I am able to successfully create the new database with the 'mysqladmin' command line
tool using the create command. However, that simply creates an "empty" database. Now the sql
scripts that I am wanting to execute on the newly created database, contain all of the information
to "populate" this database with tables, values, users, and what not. Now, the problem with
that as you can probably guess is, when I execute the the script on the database and it wants
a userid and pass, well I don't have one yet, because the database is clean and prestine.
> 
> Are that any suggestions as to a way around this issue?

Use the sql task, specify user root, use src attribute to point to
sql that creates a new user.

Doug.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message