LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-18-2014, 10:39 PM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908
Blog Entries: 26

Rep: Reputation: 49
setting password for mysql user in startup


Hi ,
I am using mysql in linux .

Code:
$ mysql --version
mysql  Ver 14.14 Distrib 5.5.17, for Linux (i686) using  EditLine wrapper
I have added following line in startup script

Code:
        sudo mysqladmin -u root password root123
Still when I try to run a jar file , I get
Quote:
$ java -jar OAAS_LCT_2.17Patch.jar
client socket created :: Ready to communicate with OLT Server
NE Type received from OLT SERVER: OFFICEDAM
flag.flagProject false
Unable to connect to the database createConnectionForDb
CGPONJdbcConnect.createinitTables()
jdbcConnect.query()create database GponLct
CGPONJdbcConnect.createinitTables()java.lang.NullPointerException
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa der.java:58)
Caused by: java.lang.NullPointerException
at com.org.cdot.gpon.lct.general.Application.CGPONJdbcConnect.createinit Tables(CGPONJdbcConnect.java:71)
at com.org.cdot.gpon.lct.general.Application.CGPONJdbcConnect.createCmDB (CGPONJdbcConnect.java:99)
at com.org.cdot.gpon.lct.general.Application.CGPONJdbcConnect.createDB(C GPONJdbcConnect.java:226)
at com.org.cdot.gpon.lct.general.Application.CGPONCentralInterface.Intia liseLCT(CGPONCentralInterface.java:231)
at com.org.cdot.gpon.lct.general.GUI.GGenOltProject.<init>(GGenOltProjec t.java:132)
at com.org.cdot.gpon.lct.general.GUI.GGenOltProject.main(GGenOltProject. java:143)
... 5 more
Now after I run startup command manually in terminal , then jar file works .

Any ideas ?
 
Old 12-18-2014, 11:07 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
None of that makes any sense, actually...

Are you referring to the mysql start script where you are setting the password?

Why would you set a root user password from the startup script?
And why would you think that would enable a client to connect to a database server?

Why would you think that had anything to do with running a jar file?
What connection parameters are set for the connection and how does the java program use them?

These are not rhetorical questions, perhaps your application instructs you to do this, but it is very strange.

Also, what distro, what java application, what does the application documentation say is required for the db connection?

Much more information would elp.
 
Old 12-22-2014, 12:14 AM   #3
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
i am using tiny core 4.7.7
i have installed mysql.tcz
Code:
~$ java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)
my jar file wants that user root should have password root123 then it can access database gponlct
I even added following script in startup to check if my sql is running then set password
Code:
#!/usr/local/bin/bash
if pgrep mysqld
then
        echo mysql running > /home/tc/mysql-log
        sudo mysqladmin -u root password root123
        echo root password for mysql set to root123 > /home/tc/mysql-log
else
        echo mysql-not-running > /home/tc/mysql-log
fi
I got /home/tc/mysql-log with
'mysql running
root password for mysql set to root123'

But password has to be set again in terminal , like before .
 
Old 12-29-2014, 09:59 PM   #4
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
even created file .my.cnf
Code:
[client]
user=root
password=root123

[mysql]
user=root
password=root123

[mysqldump]
user=root
password=root123

[mysqldiff]
user=root
password=root123
in /root & /home/tc

The problem persists .
 
Old 12-29-2014, 10:18 PM   #5
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
trying http://dev.mysql.com/doc/refman/5.1/...ion-files.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting password for LDAP user shashi386 Linux - Newbie 1 05-21-2014 07:38 PM
Setting password for a user Aruna Linux - Newbie 5 12-14-2010 01:01 AM
Problem setting root password after reinstalling mysql Venkatesh_cts Linux - Newbie 4 11-23-2006 08:05 AM
Setting a password for mysql. dave`2005 Slackware 2 05-29-2006 06:45 AM
setting user password to mysql!! baby_linu Programming 3 03-09-2004 10:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration