Access denied for user 'Administrator'@'172.16.12.34' (using password: YES)
来源:互联网 发布:淘宝 非典 编辑:程序博客网 时间:2024/06/01 12:32
今天启动系统时发现mysql报了这个错误
Access denied for user 'Administrator'@'172.16.12.34' (using password: YES)
问题就在Administrator这个用户名,但是我的系统里明明不是这个用户名
spring引入数据库配置的地方如下
<context:property-placeholder location="classpath:system.properties,classpath:druid-db-dev.properties" ignore-unresolvable="true"/>
其中druid-db-dev.properties属性文件中就是放了mysql的配置,其中用户名为username=test,可是怎么变为Administrator了呢,问题就在引入配置的方式
改为:
<context:property-placeholder location="classpath:system.properties,classpath:druid-db-dev.properties" system-properties-mode="NEVER" ignore-unresolvable="true"/>
就好了,多加了system-properties-mode=”NEVER”
再看spring-context.xsd对context:property-placeholder的解释
<xsd:element name="property-placeholder"> <xsd:annotation> <xsd:documentation><![CDATA[ Activates replacement of ${...} placeholders by registering a PropertySourcesPlaceholderConfigurer within the application context. Properties will be resolved against the specified properties file or Properties object -- so called "local properties", if any, and against the Spring Environment's current set of PropertySources. Note that as of Spring 3.1 the system-properties-mode attribute has been removed in favor of the more flexible PropertySources mechanism. However, Spring 3.1-based applications may continue to use the 3.0 (and older) versions of the spring-context schema in order to preserve system-properties-mode behavior. In this case, the traditional PropertyPlaceholderConfigurer component will be registered instead of the new PropertySourcesPlaceholderConfigurer. See ConfigurableEnvironment javadoc for more information on using. ]]></xsd:documentation> <xsd:appinfo> <tool:annotation> <tool:exports type="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"/> </tool:annotation> </xsd:appinfo> </xsd:annotation> <xsd:complexType> <xsd:complexContent> <xsd:extension base="propertyPlaceholder"> <xsd:attribute name="system-properties-mode" default="ENVIRONMENT"> <xsd:annotation> <xsd:documentation><![CDATA[ Controls how to resolve placeholders against system properties. As of Spring 3.1, this attribute value defaults to "ENVIRONMENT", indicating that resolution of placeholders against system properties is handled via PropertySourcesPlaceholderConfigurer and its delegation to the current Spring Environment object. For maximum backward compatibility, this attribute is preserved going forward with the 3.1 version of the context schema, and any values other than the default "ENVIRONMENT" will cause a traditional PropertyPlaceholderConfigurer to be registered instead of the newer PropertySourcesPlaceholderConfigurer variant. In this case, the Spring Environment and its property sources are not interrogated when resolving placeholders. Users are encouraged to consider this attribute deprecated, and to take advantage of Environment/PropertySource mechanisms. See ConfigurableEnvironment javadoc for examples. "ENVIRONMENT" indicates placeholders should be resolved against the current Environment and against any local properties; "NEVER" indicates placeholders should be resolved only against local properties and never against system properties; "FALLBACK" indicates placeholders should be resolved against any local properties and then against system properties; "OVERRIDE" indicates placeholders should be resolved first against system properties and then against any local properties; ]]></xsd:documentation> </xsd:annotation> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="ENVIRONMENT"/> <xsd:enumeration value="NEVER"/> <xsd:enumeration value="FALLBACK"/> <xsd:enumeration value="OVERRIDE"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:element>
其中就有对NEVER的解释,”NEVER” indicates placeholders should be resolved only against local properties and never against system properties;
0 0
- Access denied for user 'Administrator'@'172.16.12.34' (using password: YES)
- Access denied for user 'Administrator'@'localhost' (using password: YES)
- Access denied for user 'Administrator'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'Administrator'@'localhost' (using password: YES)
- ssm整合过程中问题记录--异常:Access denied for user 'Administrator'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'Administrator'@'localhost' (using password: YES)
- ssm 框架整合出错:Access denied for user 'Administrator'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'Administrator'@'localhost' (using password: YES)
- c3p0加载properties配置文件 报错 Access denied for user 'Administrator'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'Administrator'@'192.168.5.103' (using password: YES)
- 项目更换服务器时报Access denied for user 'administrator'@'58.32.162.450' (using password: YES)异常
- acess denied for user 'Administrator'@'localhost' (using password: YES) 解决办法
- Access denied for user 'user'@'localhost' (using password: YES)
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- 解决: Access denied for user 'mantis'@'localhost' (using password: YES)
- Access denied for user 'root'@'localhost' (using password: YES) 问题解决
- 解决'Access denied for user 'root'@'localhost' (using password: YES)'
- access denied for user 'root'@'localhost' using password yes
- android系统源码中添加app源码(源码部署移植)
- 安卓帧动画的实现
- 实现唯一Launcher
- 每天一道算法题(一) (动态规划算法)背包问题Java实现
- 剑指offer-从尾到头打印链表
- Access denied for user 'Administrator'@'172.16.12.34' (using password: YES)
- 修改System.UI并编译
- 数据库三大范式
- Manacher算法总结
- Multiple Inheritance in C++
- MySQL锁类型以及子查询锁表问题、解锁
- stax和Do4j解析xml文件,并输出txt,zip,gz格式文件
- 怎么将U盘的FAT32转换成ntfs
- This application is modifying the autolayout engine from a background thread, which can lead