ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Guptill <dgupt...@accesswave.ca>
Subject Re: perplexing exec mysql problem
Date Thu, 22 May 2003 16:32:16 GMT
On Thu, May 22, 2003 at 09:01:30AM -0700, M Damon Hill wrote:
> 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.

1. Never, never, never do anything before setting the root password.

2. Once you have set the root password, try what you have again.
   The output "Using password: NO" is slightly mystifying, since you
   have specified a password.

3. MySql is VERY fussy about access privileges.  You may have to check 
   the "user" and "db" databases as root,  to ensure that you have 
   granted your user appropriate access privileges.   The MySQL
   manual is long, however a quick look at the table of contents is
   mandatory.  Look for "The MySQL Access Privilege System".

Hpe that helps,
Doug.


Mime
View raw message