Unable to obtain JDBC connection from datasource - mysql

I was trying to run the following command in gradle and it gave me the following error :
c:\gsoc\mifosx\mifosng-provider>gradle migrateTenantListDB -PdbName=mifosplatfor
m-tenants
Listening for transport dt_socket at address: 8005
:migrateTenantListDB FAILED
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\gsoc\mifosx\mifosng-provider\build.gradle' line: 357
* What went wrong:
Execution failed for task ':flywayMigrate'.
> Unable to obtain Jdbc connection from DataSource
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 13.843 secs
The script file is here and the line no. of error is shown as 357 but I dont know why it is showing me an error. Is it something about incorrect configuration in mysql server please help me out here:
script:
task migrateTenantListDB<<{
description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
def filePath = "filesystem:$projectDir" + System.properties['file.separator'] + '..' + System.properties['file.separator'] + 'mifosng-db' + System.properties['file.separator'] + 'migrations/list_db'
def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql://localhost:3306/$tenantsDbName"
flyway.locations= [filePath]
flywayMigrate.execute()
}

The gradle script for this project has got mysql password hard-coded to mysql. You need to set your localhost password to mysql and check the connection before trying this command.

Related

Value for 'configPath' when running checkForServerUpgrade on AWS RDS

To prepare my upgrade from mysql 5.7 to mysql 8, I want to run the upgrade utility checker. Here's what I did so far:
installed mysqlsh on my machine
started mysqlsh
executed util.checkForServerUpgrade targeting the server that I want to upgrade
Here's the exact command that I used in step 3:
util.checkForServerUpgrade('root#my-remote-host:3306', { "password":"my-password" })
This runs fine but some checks are not executed because I don't provide the configPath parameter. For example, here's a warning that I get:
14) Removed system variables for error logging to the system log configuration
To run this check requires full path to MySQL server configuration file to be specified at 'configPath' key of options dictionary
More information:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-logging
Anybody knows the value that I should provide for the configPath parameter?
I've tried to do the same using the command util.checkForServerUpgrade defining the configPath, without success. I then tried to run the same command directly from outside the mysqlsh shell, with success:
mysqlsh -- util check-for-server-upgrade root#localhost --target-version=8.0.13 --output-format=JSON --config-path=/etc/mysql/my.cnf
and it worked. To be noted that when I've tried to run from mysqlsh in the session root#localhost the command:
util.checkForServerUpgrade({"configPath":"/etc/mysql/my.cnf"})
mysqlsh replied with:
"Util.checkForServerUpgrade: Argument #1: Invalid values in connection options: configPath (ArgumentError)"
Try putting in the connection string, for example,
util.checkForServerUpgrade('root#localhost',{'configPath': '/etc/my.cnf'})
This worked for me, but without the connection string it doesn't.

Mitaka nova-manage api_db sync 'error: No sql_connection parameter is established'

I am trying to set up a Mitaka OpenStack cloud. But when I try to execute:
# /usr/bin/nova-manage --debug api_db sync
And the I get the error message:
error: No sql_connection parameter is established
Yet I am able to access the nova database via mysql command line, using the values I am using for my I have in the /etc/nova/nova.conf:
[database]
connection=mysql://nova:nova#svl-os:3306/nova
In the Mitaka release they added a new DB schema, nova_api. So I needed to add ...
[api_database]
connection=mysql://nova_api_db_user:password#mydbhost:3306/nova_api
... to my /etc/nova/nova.conf file.

Tracing mysql-java-connector errors

We are using BirtActuate in our application in showing reports.
Actuate -----> JDBC driver --------> MysqlDB
We are aiming to TRACE errors that appears while connecting via JDBC to mysql.
We have followed instructions available at http://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html
and tried making connection using following connection string:
jdbc:mysql://192.168.0.1/TestDB?interactiveClient=true&autoReconnect=true&profileSQL=true&traceProtocol=true
As per the documentation of logger parameter in link mentioned we found that
The name of a class that implements "com.mysql.jdbc.log.Log" that will
be used to log messages to. (default is
"com.mysql.jdbc.log.StandardLogger", which logs to STDERR)
We want to trap all errors in a file so we can send that to support people to help us solving issues. I do not really know how to do that.
Adding &profileSQL=true&traceProtocol=true to JDBC connection URL will cause extra traces to be logged by the BirtActuate's default's logger in directory which in present birtActuateServer is $BIRT_HOME/server/data/logs
Go to the logs directory and run on command prompt
> grep -rl com.mysql.jdbc.exceptions .
This command should list the files in which it has found "com.mysql.jdbc.exceptions" string

Not Able to stop Mysql

I want to stop mysql inorder to start it in rescue mode to retrieve my mysql password but its showing my me an error message and won't stop.
service mysql stop
OUTPUT:
stop: Rejected send message, 1 matched rules; type="method_call",
sender=":1.131" (uid=1000 pid=7640 comm="stop mysql ")
interface="com.ubuntu.Upstart0_6.Job" member="Stop" error
name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart"
(uid=0 pid=1 comm="/sbin/init")
output of
etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the
service(8) utility, e.g. service mysql stop
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
stop: Rejected send message, 1 matched rules; type="method_call",
sender=":1.129" (uid=1000 pid=7246 comm="stop mysql ")
interface="com.ubuntu.Upstart0_6.Job" member="Stop" error
name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart"
(uid=0 pid=1 comm="/sbin/init") subhransu#subhransu-Inspiron-1545:~$
service mysql stop stop: Rejected send message, 1 matched rules;
type="method_call", sender=":1.130" (uid=1000 pid=7400 comm="stop
mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error
name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart"
(uid=0 pid=1 comm="/sbin/init")
Try:
sudo service mysql stop
You have to be root to start and stop mysql server.
If you are not root, you must be a sudo-able user, you must use the command sudo and you must know your sudo-password.

getaddrinfo: start Temporary failure in name resolution Error opening specified endpoint "start" Server Exiting with code 1

While starting snmpd I am getting this error in /var/snmpd.log
**
> *getaddrinfo: start Temporary failure in name resolution Error opening
specified endpoint "start" Server Exiting with code 1*
**
For your info m using Fedora-14 & net-snmp-5.7.1 .
Thanks in Advance..Help me
Error opening specified endpoint "start" Server Exiting with code 1
means some process is using port 161.
For example try netstat -anp | grep 161, then stop that process and start snmpd again.