java.sql.SQLException: Access denied for user 'root'@'d001' (using password: YES)
在安装CDH的时候报错了:
root@d001:/var/cache/yum/x86_64//base# /opt/cm-5.13./share/cmf/schema/scm_prepare_database.sh mysql cdh -hd001 -uroot -proot -pwordemotion --scm-host d001 root root --force
JAVA_HOME=/soft/jdk1..0_144
Verifying that we can write to /opt/cm-5.13./etc/cloudera-scm-server
[ main] DbProvisioner ERROR Exception when creating/dropping database with user 'root' and jdbc url 'jdbc:mysql://d001/?useUnicode=true&characterEncoding=UTF-8'
java.sql.SQLException: Access denied for user 'root'@'d001' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at java.sql.DriverManager.getConnection(DriverManager.java:)
at java.sql.DriverManager.getConnection(DriverManager.java:)
at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:)
at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:)
at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:)
[ main] DbProvisioner ERROR Stack Trace:
java.sql.SQLException: Access denied for user 'root'@'d001' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at java.sql.DriverManager.getConnection(DriverManager.java:)
at java.sql.DriverManager.getConnection(DriverManager.java:)
at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:)
at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:)
at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:)
--> Error , ignoring (because force flag is set)
Creating SCM configuration file in /opt/cm-5.13./etc/cloudera-scm-server
Executing: /soft/jdk1..0_144/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/opt/cm-5.13./share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /opt/cm-5.13.0/etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
[ main] DbCommandExecutor INFO Successfully connected to database.
All done, your SCM database is configured correctly!
我们研究一下 scm_prepare_database.sh的参数
/opt/cm-5.13./share/cmf/schema/scm_prepare_database.sh --help
usage: /opt/cm-5.13./share/cmf/schema/scm_prepare_database.sh [options] (postgresql|mysql|oracle) database username [password] Prepares a database (currently either MySQL, PostgreSQL or Oracle)
for use by Cloudera Service Configuration Manager (SCM):
o Creates a database (For PostgreSQL and MySQL only)
o Grants access to that database, by:
- (PostgreSQL) Creating a role
- (MySQL) Creating a grant
o Creates the SCM database configuration file.
o Tests if the database connection parameters are valid. MANDATORY PARAMETERS
database type: either "oracle", "postgresql" or "mysql"
database: For PostgreSQL and MySQL, name of the SCM database to create.
For Oracle this is the SID of the Oracle database.
username: Username for access to SCM's database. OPTIONAL PARAMETERS
password: Password for the SCM user. If not provided, and --scm-password-script
is not specified as an option, will prompt for it. OPTIONS
-h|--host Database host. Default is to connect locally.
-P|--port Database port. If not specified, the database specific
default will be used: namely, for MySQL,
for PostgreSQL, and for Oracle.
-u|--user Database username that has privileges for creating
users and grants. The default is 'centos'.
Typical values are 'root' for MySQL and
'postgres' for PostgreSQL. Not applicable for Oracle.
-p|--password Database Password. Default is no password.
--scm-host SCM server's hostname. Omit if SCM is colocated with MySQL.
--config-path Path to SCM configuration files.
Default is /etc/cloudera-scm-server.
--scm-password-script Instead of obtaining the SCM username's password
directly, execute a script whose stdout is used as the
password.
-f|--force Don't stop when an error is encountered.
-v|--verbose Print more informational messages.
-?|--help Show this message. NOTE ON POSTGRESQL CONFIGURATION
PostgreSQL must be configured to accept connections
with md5 password authentication. To do so,
edit /var/lib/pgsql/data/pg_hba.conf (or similar)
to include "host all all 127.0.0.1/32 md5" _above_
a similar line that allows 'ident' authentication.
/opt/cm-5.13.0/share/cmf/schema/scm_prepare_database.sh mysql cdh -hd001 -uroot -proot -pwordemotion --scm-host d001 root root --force
调整成
/opt/cm-5.13.0/share/cmf/schema/scm_prepare_database.sh -hd001 -P3306 --scm-host d001 --force mysql cdh root root
java.sql.SQLException: Access denied for user 'root'@'d001' (using password: YES)的更多相关文章
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
在更新项目之后,做了一定的改动后发现竟然报错了,刚才还好好的. java.sql.SQLException: Access denied for user 'root'@'localhost' (us ...
- 技术笔记1:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password)
在myEclipse10中运行java项目的时候,遇到java.sql.SQLException: Access denied for user 'root'@'localhost' (using p ...
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 解决办法
一.背景 在Spark中,将DStream写入到MySQL出现错误:java.sql.SQLException: Access denied for user 'root'@'localhost' ( ...
- [Spring MVC - 2A] - java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
严重: Servlet.service() for servlet [springMVC] in context with path [/ExceptionManageSystem] threw ex ...
- 数据库异常 :java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
最近在新项目中突然出现了 java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) ...
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)解决方案
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) at com.mysql. ...
- Eclipse使用jdbc连接MySql数据库报:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
在使用eclipse连接mysql数据库时报异常: java.sql.SQLException: Access denied for user 'root'@'localhost' (using pa ...
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
:: - [localhost-startStop-] INFO - Root WebApplicationContext: initialization started -- :: - [local ...
- java.sql.SQLException: Access denied for user 'root '@'localhost' (using password: YES) 最蠢
我犯了七年前的错误,一个空格,昨天就想到的,还对比了一下密码有没有空格 问题原因1:多写空格 在datasource.properties 中的username 的值root后面多写了一个空格, jd ...
随机推荐
- 域名查询是否注册的demo
import json import multiprocessing import threading import requests import xmltodict # 万网查询 def chec ...
- 【Java基础】对象序列化与读写
package com.test.io; import java.io.FileInputStream; import java.io.FileNotFoundException; import ja ...
- MySQL:添加用户、删除用户、授权、远程访问、修改密码
1.创建用户 #test表示你要建立的用户名,后面的123456表示密码, #localhost限制在固定地址localhost登陆 CREATE USER test@localhost IDENTI ...
- MySQL 服务正在启动 MySQL 服务无法启动解决途径
解决方案: 1.删除自己手动创建的data文件夹: 2.管理员权限CMD的bin目录下,移除已错误安装的mysqld服务: mysqld -remove MySQL出现删除成功! 3.在CMD的bin ...
- win10电脑休眠后无法唤醒的解决办法
电脑的休眠功能,为长时间不用的电脑进行了关闭显示.硬盘停转的深度节能模式,不仅节约能源,还保护设备. 但有些时候也会出现一些问题,如休眠后无法唤醒,无法移动鼠标,敲击键盘都无效,最后只能长按电源键来强 ...
- Python xlsxwriter库 图表Demo
折线图 import xlsxwriter # 创建一个excel workbook = xlsxwriter.Workbook("chart_line.xlsx") # 创建一个 ...
- python小游戏2
import hashlib 过段时间会来解释下hashlib的源码(能力有限请大家谅解)#根据md5模块来加密密码 def pwd_md5(pwd): ''' 加密用户输入过来的密码 :param ...
- Spring(七)--Spring JDBC
Spring JDBC 1.需要的实体类和数据库 2.需要的dao层 package com.xdf.dao; import com.xdf.bean.Student; import org.spri ...
- sqlserver with(nolock)而mysql 不需nolock
nolock 是 SQL Server 特有的功能. 例如:对于一个表 A,更新了一行,还没有commit,这时再select * from A 就会死锁.用select * from A(noloc ...
- __strong修饰符
本文用来观察,对于__strong修饰符,编译器为我们自动添加了什么代码,这些代码对于引用计数有什么影响. 例子一 X __strong *x1 = [[X alloc] init]; 使用控制台打印 ...