aws java mysql_java - AWS EC2 / MySql - spring boot无法从datasource确定jdbc url - 堆栈内存溢出...

我有一个简单的Spring Boot应用程序,我试图在基于Amazon AMI的Amazon EC2实例上部署。 它使用MySql数据库(版本8.0.15)。

我在AWS上创建了数据库,当我从本地系统指向它的配置时,它可以工作。 我也可以从MySql Workbench访问它。

但是当我将Spring Boot jar文件上传到EC2实例并运行它时,它无法连接到数据库,并显示消息“无法从数据源确定jdbc url”:

2019-05-31 20:51:38.266 WARN 5150 --- [ main] o.s.b.a.orm.jpa.DatabaseLookup : Unable to determine jdbc url from datasource

org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

以下是配置中的相关条目:

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

spring.jpa.hibernate.ddl-auto=update

spring.datasource.url=jdbc:mysql://mydbinstance.xxxxxxxx.us-east-2.rds.amazonaws.com:3306/todo_db

spring.datasource.username=root

spring.datasource.password=mypassword

服务器上的java版本是

OpenJDK Runtime Environment (build 1.8.0_201-b09)

在我的本地系统上,java版本是

Java(TM) SE Runtime Environment (build 1.8.0_152-b16)

以下是pom.xml的内容:

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

org.springframework.boot

spring-boot-starter-parent

2.1.1.RELEASE

com.todoapp.com.webservices

restful-web-services

0.0.1-SNAPSHOT

restful-web-services

Todo restful App built in Spring Boot

1.8

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-data-jpa

org.springframework.boot

spring-boot-starter-jdbc

mysql

mysql-connector-java

runtime

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-security

io.jsonwebtoken

jjwt

0.9.1

org.springframework.boot

spring-boot-devtools

runtime

org.springframework.boot

spring-boot-starter-test

test

org.springframework.boot

spring-boot-maven-plugin

这是一个更完整的堆栈跟踪。 关于无法读取URL的错误最后会出现。

2019-06-01 02:04:25.434 INFO 14791 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...

2019-06-01 02:04:26.696 ERROR 14791 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136) ~[HikariCP-3.2.0.jar!/:na]

at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369) ~[HikariCP-3.2.0.jar!/:na]

at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198) ~[HikariCP-3.2.0.jar!/:na]

at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467) [HikariCP-3.2.0.jar!/:na]

at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541) [HikariCP-3.2.0.jar!/:na]

at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) [HikariCP-3.2.0.jar!/:na]

at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) [HikariCP-3.2.0.jar!/:na]

at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151) [spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) [spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) [spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:319) [spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:356) [spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.boot.autoconfigure.orm.jpa.DatabaseLookup.getDatabase(DatabaseLookup.java:73) [spring-boot-autoconfigure-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.determineDatabase(JpaProperties.java:142) [spring-boot-autoconfigure-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter(JpaBaseConfiguration.java:112) [spring-boot-autoconfigure-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$f5c20854.CGLIB$jpaVendorAdapter$5() [spring-boot-autoconfigure-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$f5c20854$$FastClassBySpringCGLIB$$81884254.invoke() [spring-boot-autoconfigure-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) [spring-core-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) [spring-context-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$f5c20854.jpaVendorAdapter() [spring-boot-autoconfigure-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]

at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1237) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1237) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083) ~[spring-context-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:853) ~[spring-context-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) ~[spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) ~[spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

at com.todoapp.com.webservices.restfulwebservices.RestfulWebServicesApplication.main(RestfulWebServicesApplication.java:10) ~[classes!/:0.0.1-SNAPSHOT]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]

at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]

at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[restful-web-services-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[restful-web-services-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) ~[restful-web-services-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]

at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) ~[restful-web-services-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]

Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_212]

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_212]

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_212]

at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_212]

at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.NativeSession.connect(NativeSession.java:152) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

... 84 common frames omitted

Caused by: java.net.ConnectException: Connection refused (Connection refused)

at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_212]

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_212]

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_212]

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_212]

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_212]

at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_212]

at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65) ~[mysql-connector-java-8.0.13.jar!/:8.0.13]

... 87 common frames omitted

2019-06-01 02:04:26.701 WARN 14791 --- [ main] o.s.b.a.orm.jpa.DatabaseLookup : Unable to determine jdbc url from datasource

org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

任何帮助将非常感激。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/528419.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

debian 删除mysql数据库_Debian中完全卸载MySQL的方法

作者: 字体:[增加 减小] 类型:转载这篇文章主要介绍了Debian中完全卸载MySQL的方法,同时介绍了清理方法,可以做到彻底卸载mysql,需要的朋友可以参考下之前服务器上配置测试用的服务环境,我偷懒顺手用网上现成的脚本进行安装&#…

python123外汇兑换计算器_Python 3.x--使用re模块,实现计算器运算实例

1 importre23 #乘除运算处理,可以处理不含括号的加减和乘除函数(只处理乘除)4 defmulti_and_divi(arg):5 #传入参数为列表,如:[3*2-1*9/3,0]6 val arg[0]7 #对字符串进行乘除匹配:如3*2-1*9/3,就匹配:3*28 …

python修改文件名字数字_python实现多进程按序号批量修改文件名的方法示例

本文实例讲述了python实现多进程按序号批量修改文件名的方法。分享给大家供大家参考,具体如下:说明文件名命名方式如图,是数字序号开头,但是中间有些文件删掉了,序号不连续,这里将序号连续起来,…

遗传算法求函数最大值实验_小知识:什么是遗传算法

1 什么是遗传算法遗传算法(GeneticAlgorithm, GA)是模拟达尔文生物进化论的自然选择和遗传学机理的生物进化过程的计算模型,是一种通过模拟自然进化过程搜索最优解的方法。其主要特点是直接对结构对象进行操作,不存在求导和函数连续性的限定;…

$dbms=mysql_Oracle dbms

Oracle dbms_random包的用法 Oracle dbms_random包的用法 1.dbms_random.value方法 dbms_random是一个可以生成随机数或者字符串的程序包。这个包有initialize()、seed()、terminate()、value()、normal()、random()、string()等几个函数,但value()是最常用Oracle d…

js定位div坐标存入mysql_JavaScript与Div 对层定位和移动获得坐标

1:移动图层 获得点的x轴y轴坐标,从而进行绝对定位(注意:竖拉框会影响 x 轴 y 轴坐标值)var x,y,z,downfalse,objfunction init(){objevent.srcElement //事件触发对象obj.setCapture() //设置属于当前对象的鼠标捕捉zobj.style.zIndex …

mysql 不指定 长度吗_mysql中整数类型后面的数字,是不是指定这个字段的长度?比如int(11),11代表11个字节吗?...

原先对mysql不太理解,但也没有报错。但理解的不够深入。这次补上。原来以为int(11)是指11个字节,int(10)就是10个字节。我错了。http://zhidao.baidu.com/link?urlpuYWaGBQNKNHgffO5kdvXshF3KmX8OuB4Mor3HXapbNHa8m1CdlF8PJTqVuKa1eKcEd6Bv2NKUr3I-KJr5…

python绘制折线图显示数据_漂亮图表也可用python信手拈来!一文教你学会用Python绘制堆积折线图...

今天,和大家聊聊关于Python绘图相关的东东哦,还是和大家继续深耕Python经典的matplotlib库哦!好啦,咱们就开始吧!首先,咱们聊聊如何在Python中去绘制经典的堆积折线图到这可能有些朋友可能会问了&#xff1…

linux下使用odbc连接mysql_Linux环境下通过ODBC访问MSSql Server

为了解决Linux系统连接MSSql Server的问题,微软为Linux系统提供了连接MSSql Server的ODBC官方驱动。通过官方驱动,Linux程序可以方便地对MSSql Server进行访问。官网提供了三个版本的驱动,分别用于以下发行版的Linux系统:64bit Re…

python画图代码对比_Python实现代码差异对比分析

在写代码过程,有时需要对比查看两个代码文件的不同,肉眼查看费事费力,很难进行对比找出不同。例如,程序运行报错时,会对比自己先前写的代码或者参考别人代码,有哪些地方不对,此时便可以通过该程…

insert into user mysql root_跳过授权表登录后使用insert into创建root权限用户

起因:刚刚搭建好的mysql数据库,做基础优化时,不小心把所有用户都删除了,并且退出了。没办法,只好跳过授权表登录,新建root用户。过程如下:一、停掉mysql,跳过授权登录[rootexplnk-za…

matplotlib 设置标注方向_Python 使用matplotlib画图添加标注、及移动坐标轴位置

import matplotlib.pyplot as pltimport matplotlibimport numpy as np#解决中文乱码问题,引入windows字体库myfont matplotlib.font_manager.FontProperties(fnamerC:/Windows/Fonts/msyh.ttf)x np.linspace(-3,3,50)y 2*x 1plt.plot(x,y)plt.figure(1,figsize…

flyway配置mysql_Flyway快速上手教程

一、Flyway是什么官网解释地非常全面,可先大致阅读一下。简单地说,flyway是一个能对数据库变更做版本控制的工具。二、为什么要用Flyway在多人开发的项目中,我们都习惯了使用SVN或者Git来对代码做版本控制,主要的目的就是为了解决…

mysql主从 单点_MySQL主从复制虽好,能完美解决数据库单点问题吗?

一、单个数据库 服务器 的缺点数据库服务器存在单点问题;数据库服务器资源无法满足增长的读写请求;高峰时数据库连接数经常超过上限。二、如何解决单点问题增加额外的数据库服务器,组建数据库集群;同一集群中的数据库服务器需要具…

java包含关系图_Java——Spring框架完整依赖关系图!再复习了解加工一下吧?

因为spring-core依赖了commons-logging,而其他模块都依赖了spring-core,所以整个spring框架都依赖了commons-logging,如果有自己的日志实现如log4j,可以排除对commons-logging的依赖,没有日志实现而排除了commons-logg…

java ora 28040_Oracle 11g与112c中ORA-28040 错误解决

今天遇到一个连接192.168.56.102这个库报错Java.sql.SQLException: ORA-28040: No matching authentication protocolOracle 12C下查询此报错oralce:/oracle/db/app/12.1.0/db/network/admin> oerr ora 2804028040, 0000, "No matching authentication protocol"/…

java中有序数组比无序数值好_java面向对象的有序数组和无序数组的比较

packageaa;classArray{//定义一个有序数组private long[] a;//定义数组长度private intnElems;//构造函数初始化public Array(intmax){a new long[max];nElems 0;}//size函数public intsize(){returnnElems;}//定义添加函数public void insert(longvalue){//将value赋值给数组成…

java成员的访问权限_Java成员的访问权限

类中某成员(方法或属性,method or field)的访问权限:1、package(或称为friendly,但不用写出,friendly也不是关键字)权限,在同一包中的类和继承该类的子类可以访问;2、public权限,任何类都可以访问;3、priva…

java jvm 加载类的顺序_java JVM-类加载静态初始化块调用顺序

测试类加载的全过程public class Have {static {System.out.println("加载Have");//先加载Have再调用main方法}public static void main(String[] args) throws Exception {System.out.println("main方法"); //先调main方法A anew A(); //先初始化父类&…

lua jit java jit_Lua JIT 2.0 发布了,一百五十倍的性能提升!

jzhang2014-4-7 15:44:00阅读(2432)评论(2)先把官方主页摆出来:外链网址已屏蔽luajit.org/luajit.htmlLua JIT 1.0早就有了,但是性能一般,这次的2.0是重新编写的,优化效果有了质的飞跃。下面这个表是作者的测试结果,其…