Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26526

Re: Bash script not working as commandline MySQL JDBC

From markspace <markspace@nospam.nospam>
Newsgroups comp.lang.java.programmer
Subject Re: Bash script not working as commandline MySQL JDBC
Date 2013-11-17 08:56 -0800
Organization A noiseless patient Spider
Message-ID <l6asf6$9kn$1@dont-email.me> (permalink)
References <7f1a4290-6ce6-4673-a411-62dbb326ef99@googlegroups.com>

Show all headers | View raw


On 11/17/2013 8:40 AM, RVic wrote:
> I'm quite at a loss here.I'm using JDBC to connect to a MySQL
> database. If I type the command in from the command line (passing it
> the parameters for db name and user / password) it runs fine:
>
> exec java -classpath
> .:$CLASSPATH:/home/user/ggrip/upserver/mysql-connector-java-5.1.26-bin.jar:/home/user/ggrip/upserver/GGUser.jar
> GG.GGServer "127.0.0.1:3306" ggripserver1 ggripv2 root root
>
> However, if I create a bash file of the identical command and execute
> it, I'm getting: user@Mint15-32 ~/ggrip/upserver $ echo $SHELL
> /bin/bash user@Mint15-32 ~/ggrip/upserver $ ./ggrip.sh
> java.sql.SQLException: Access denied for user 'root'@'localhost'
> (using password: YES)Error creating connection pool!
> java.sql.SQLException: Can't connect with: com.mysql.jdbc.Driver to
> jdbc:mysql://127.0.0.1:3306/ggripv2 root root
>
> I just don't get it?
>



My guesses are 1) you have a typo, since you didn't show us the actual 
script, or 2) you there's a shell or variable expansion that's tripping 
you up.

Look up bash shell debugging, try a few things there, and let us know 
when you've found a few things more.  Make sure the command is executing 
exactly as you expect, not some close but different facsimile.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bash script not working as commandline MySQL JDBC RVic <rvince99@hotmail.com> - 2013-11-17 08:40 -0800
  Re: Bash script not working as commandline MySQL JDBC markspace <markspace@nospam.nospam> - 2013-11-17 08:56 -0800
  Re: Bash script not working as commandline MySQL JDBC RVic <rvince99@hotmail.com> - 2013-11-17 09:16 -0800
    Re: Bash script not working as commandline MySQL JDBC Robert Klemme <shortcutter@googlemail.com> - 2013-11-17 20:01 +0100
    Re: Bash script not working as commandline MySQL JDBC Steven Simpson <ss@domain.invalid> - 2013-11-17 19:34 +0000
  Re: Bash script not working as commandline MySQL JDBC RVic <rvince99@hotmail.com> - 2013-11-17 12:38 -0800
    Re: Bash script not working as commandline MySQL JDBC Robert Klemme <shortcutter@googlemail.com> - 2013-11-17 22:06 +0100
    Re: Bash script not working as commandline MySQL JDBC Mike Amling <mamling@chaff.us> - 2013-11-17 16:09 -0600

csiph-web