Created 07-17-2018 06:44 AM
Hello,
I have installed mysql database as external database and I'm trying to run scm_prepare_database.sh script and I get this error;
[root@cm mysql]# /usr/share/cmf/schema/scm_prepare_database.sh mysql -h localhost -u temp -p --verbose scmdb scmuser
Enter database password:
Enter SCM password:
JAVA_HOME=/usr/java/jdk1.8.0_171-amd64/
Verifying that we can write to /etc/cloudera-scm-server
Database type: mysql
Database user: temp
Executing: /usr/java/jdk1.8.0_171-amd64//bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/usr/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbProvisioner --create -h localhost -u temp -H localhost -U scmuser -d scmdb -t mysql
[ main] DbProvisioner ERROR Exception when creating/dropping database with user 'temp' and jdbc url 'jdbc:mysql://localhost/?useUnicode=true&characterEncoding=UTF-8'
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_171]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_171]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_171]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_171]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)[mysql-connector-java.jar:]
at com.mysql.jdbc.Util.getInstance(Util.java:386)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2570)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:839)[mysql-connector-java.jar:]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)[mysql-connector-java.jar:]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_171]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_171]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_171]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_171]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:421)[mysql-connector-java.jar:]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:350)[mysql-connector-java.jar:]
at java.sql.DriverManager.getConnection(DriverManager.java:664)[:1.8.0_171]
at java.sql.DriverManager.getConnection(DriverManager.java:247)[:1.8.0_171]
at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:296)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:104)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:123)[db-common-5.15.0.jar:]
[ main] DbProvisioner ERROR Stack Trace:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_171]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_171]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_171]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_171]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)[mysql-connector-java.jar:]
at com.mysql.jdbc.Util.getInstance(Util.java:386)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)[mysql-connector-java.jar:]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2570)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:839)[mysql-connector-java.jar:]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)[mysql-connector-java.jar:]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_171]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_171]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_171]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_171]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)[mysql-connector-java.jar:]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:421)[mysql-connector-java.jar:]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:350)[mysql-connector-java.jar:]
at java.sql.DriverManager.getConnection(DriverManager.java:664)[:1.8.0_171]
at java.sql.DriverManager.getConnection(DriverManager.java:247)[:1.8.0_171]
at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:296)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:104)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:123)[db-common-5.15.0.jar:]
--> Error 1, giving up (use --force if you wish to ignore the error)
Could you help me on this?
Best regards,
Huriye
Created 07-23-2018 06:34 AM
Hello,
I dont know how exactly I can use the test code. I dont have java know-how.
Thanks,
Huriye
Created 07-24-2018 10:49 AM
You can also review tcpdump output to see if a conneciton is being made. Check your mysql logs to see if a connection attempt is registered, etc.
Somewhere between the JDBC driver and your mysql server there is a failure of some sort, so diagnostics need to be performed to figure out what is failing.
This may take some digging, so if you have friends, colleagues, etc. who can work with you on this system and know how to debug these sort of connection issues, I'd ask them for some help.
I was suggesting the java app to test as an example of something you might try, but if it is outside your skillset, then there may be other ways.
Start by seeing if you can determine if the JDBC connection is able to reach its destination (mysql server).
Created 07-25-2018 01:56 AM
Hello,
I resolved the error which wasa "Unable to find jdbc" by defining the full jar file name in /etc/defaul/cloudera-scm-server. But now I am getting another issue which is;
[ main] DbProvisioner ERROR Exception when creating/dropping database with user 'root' and jdbc url 'jdbc:mysql://localhost/?useUnicode=true&characterEncoding=UTF-8'
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Support123*'' at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:118)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:790)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:675)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:299)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:104)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:123)[db-common-5.15.0.jar:]
[ main] DbProvisioner ERROR Stack Trace:
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Support123*'' at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:118)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:790)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:675)[mysql-connector-java-8.0.11.jar:8.0.11]
at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:299)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:104)[db-common-5.15.0.jar:]
at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:123)[db-common-5.15.0.jar:]
--> Error 1, giving up (use --force if you wish to ignore the error)
I have changed the password and tried again but getting the same error.
Could you help me on this please?
Thanks,
Huriye
Created 07-25-2018 12:49 PM
I could be wrong, but now it appears to be breaking earlier (before a connection is attempted).
Also, I note dthat you are using mysql-connector-java-8.0.11.jar which we do not currently support and we know will cause problems if you are able to get past this problem. What command line did you use to generate this error... it appears the error is saying there is a problem with the syntax of the query and the query is generated based on the options you supplied. Is it possible you have mismatched quotes around your password?
Created 07-26-2018 11:44 PM
Hello,
I changed the jar file name as mysql-connector-java.jar then I get error which password is not suitable for the policy. But removed my redhat machines and created Centos. Now I dont have any error to connecting mysql database.
I still dont know what was the problem.
Thanks,
Huriye