连接阿里云数据库RDS失败,想选40C币 没有那么多了,请大家帮帮忙,急

想选40C币 没有那么多了,请大家帮帮忙,急
2018-06-16 08:55:59.902 ERROR 29945 --- [MessageThread_1] 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:741)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:56)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1683)
at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:656)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:349)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:221)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:123)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:365)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:194)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:460)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:534)
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82)
at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68)
at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:338)
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
at com.sun.proxy.$Proxy59.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
at com.sun.proxy.$Proxy60.saveUserLoginInfo(Unknown Source)
at com.giska.skill.service.LaoLuShiTangSkillImpl.onStart(LaoLuShiTangSkillImpl.java:49)
at com.giska.skill.control.controller.StartSkillController.control(StartSkillController.java:46)
at com.giska.skill.control.ControllerManager.control(ControllerManager.java:100)
at com.giska.skill.control.LaoLuShiTangSkillProcessor.process(LaoLuShiTangSkillProcessor.java:132)
at com.aibasis.process.ProcessorManager.process(ProcessorManager.java:36)
at com.aibasis.mq.RedHareEndMQListener.consume(RedHareEndMQListener.java:31)
at com.aliyun.openservices.ons.api.impl.rocketmq.ConsumerImpl$MessageListenerImpl.consumeMessage(ConsumerImpl.java:172)
at com.aliyun.openservices.shade.com.alibaba.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService$ConsumeRequest.run(ConsumeMessageConcurrentlyService.java:413)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.cj.core.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)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:93)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:133)
at com.mysql.cj.core.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:149)
at com.mysql.cj.mysqla.io.MysqlaSocketConnection.connect(MysqlaSocketConnection.java:83)
at com.mysql.cj.mysqla.MysqlaSession.connect(MysqlaSession.java:139)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1803)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1673)
... 46 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mysql.cj.core.io.StandardSocketFactory.connect(StandardSocketFactory.java:202)
at com.mysql.cj.mysqla.io.MysqlaSocketConnection.connect(MysqlaSocketConnection.java:57)
... 49 common frames omitted

4个回答

https://blog.csdn.net/JustinQin/article/details/78630100?locationNum=9&fps=1

解决办法
1、使用JDBC URL中使用autoReconnect属性,url追加红色部分内容
jdbc.url=jdbc:mysql://192.168.0.109:3306/test?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
2、修改MySQL的参数vim /etc/my.cnf,在[mysqld]后面添加以下内容(365天=31536000秒)
wait_timeout=31536000
interactive_timeout=31536000
3、重启mysql
#service mysql restart

再不行,请咨询阿里云客服

这里有解决连接问题的办法汇总:
https://help.aliyun.com/knowledge_detail/96028.html

莫名其妙就好了,谢谢大家

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
阿里云数据库rds版白名单的ip是根据什么设置

![如图所示](https://img-ask.csdn.net/upload/201903/25/1553488806_181907.png) 我是一个小白

本地java项目如何连接阿里云服务器上的mysql?

自己在阿里云服务器ubuntu上安装了mysql5.6,权限和防火墙都已经设置。现在本地客户端navicat通过SSH通道可以连接上mysql,但是本地的java项目通过阿里云IP:port的方式连接不了,项目框架里可没有ssh通道配置啊。请问各位大神,有没有遇到过这样的问题?怎么解决的啊?

ogg是否支持目标端数据库是在阿里云的RDS云MYSQL

源端是Oracle数据库,目标端是阿里云的RDS云MYSQL。这样是否适合做数据同步

我用Navicat for Mysql 连接 阿里云的远程服务器

本地服务器:windows 7服务器 阿里云服务器:windows Server 2008 本地软件:Navicat for Mysql 请问怎么用本地软件Navicat for Mysql连接远程阿里云服务器的数据库 具体配置是怎么配置的。

.net 连接阿里云上的mysql数据库一直报错

代码如下: using MySql.Data; using MySql.Data.MySqlClient; static void Main(string[] args) { string str = "Database=chu;Data Source=rdsja29d3bs0j0z1jg55.mysql.rds.aliyuncs.com;Port=3306;User Id=XXX;Password=XXX;Charset=utf8"; MySqlConnection conn = new MySqlConnection(str); conn.Open(); } 每次在conn.open()这里都会提示: Unable to connect to any of the specified MySQL hosts. 换了好几个DLL都不行。

阿里云主机 访问时候连接不到数据库

![图片说明](https://img-ask.csdn.net/upload/201804/17/1523951067_64801.png)

在阿里云安装完mysql,如何内网访问

系统 centos 7.3 现在只能外网访问,请教内网访问的方法

Amazon RDS:如何将数据库导入亚马逊RDS实例?

<div class="post-text" itemprop="text"> <p>I am using Amazon EC2 with Amazon RDS.</p> <p>I have successfully created database and uploaded code to amazon using Elastic Beanstalk. Now I want to import my local databse data to RDS databse. I surf and found that by <code>mysql command</code> we can do that so I do this</p> <pre><code>D:\wamp\bin\mysql\mysql5.5.8\bin&gt;mysql --host=myinstances.aa23swersdf.us-east-1.rds.amazonaws.com --user=username --pass=password --port=3306 dbname &lt; locahost.sql </code></pre> <p>But it throws this error :</p> <pre><code>ERROR 2003 (HY000): Can't connect to MySQL server on 'myinstances.aa23swersdf.us-east-1.rds.amazonaws.com' (10060) </code></pre> <p>How can I solve it?</p> <p>I have do this by cmd on windows.</p> </div>

在Openresty中连接阿里云的RDS出现 域名could not be resolved

![图片说明](https://img-ask.csdn.net/upload/201610/13/1476351570_5505.png) ![图片说明](https://img-ask.csdn.net/upload/201610/13/1476351579_805099.png)

在php中测试数据库连接失败

<div class="post-text" itemprop="text"> <p>I've set up a database using MAMP. When I try the following test, I only receive a blank page. Fairly new to this, and I've tried different suggestions found on the web with no luck. Tried using both port and socket.</p> <pre><code>&lt;?php $user = 'root'; $password = 'root'; $db = 'test'; $host = 'localhost'; $port = 3306; $socket = "/Applications/MAMP/tmp/mysql/mysql.sock"; $link = mysql_connect( "$host:$socket", $user, $password ); $db_selected = mysql_select_db( $db, $link ); if (!$link){ echo "ERROR"; } else { echo "Success"; } mysql_close($link); ?&gt; </code></pre> </div>

阿里云-RDS-MySQL-5.5计算问题

第一部分:问题描述 &nbsp; 1.问题简述: 有一SQL语句,在 [阿里云-RDS-MYSQL] 和 [非阿里云-MYSQL] 环境里执行,得出的结果不一样 &nbsp; 2.运行环境: A: [阿里云-RDS-MySQL- 5.5.18.1-Alibaba-rds-201406-log] ``` mysql>SHOW VARIABLES LIKE "%version%" +-------------------------+---------------------------------+ | Variable_name | Value | +-------------------------+---------------------------------+ | innodb_version | 1.1.8-20.1 | | protocol_version | 10 | | slave_type_conversions | | | version | 5.5.18.1-Alibaba-rds-201406-log | | version_comment | Source distribution | | version_compile_machine | x86_64 | | version_compile_os | Linux | +-------------------------+---------------------------------+ ``` &nbsp; B: [非阿里云-MySQL] ``` mysql> SHOW VARIABLES LIKE "%version%"; +-------------------------+------------------------------+ | Variable_name | Value | +-------------------------+------------------------------+ | innodb_version | 5.6.24 | | protocol_version | 10 | | slave_type_conversions | | | version | 5.6.24 | | version_comment | MySQL Community Server (GPL) | | version_compile_machine | x86_64 | | version_compile_os | Linux | +-------------------------+------------------------------+ 7 rows in set (0.00 sec) ``` &nbsp; 3.SQL语句: ``` select (((((237803.3300+1659482.4400)/2.00)/1182208.5700)*30.00*6)+(0.50*(((((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6))-(((((360.00*((1527268.4000-1182208.5700)-((2587.0000-((5354427.3100*0.0400*6)/12.00))+99354.4800+10550.5600)))/((((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6))*0.5))-(0.50*((2587.0000-((5354427.3100*0.0400*6)/12.00))+99354.4800+10550.5600)))*(((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6)))/1182208.5700))-((((237803.3300+1659482.4400)/2.00)/1182208.5700)*30.00*6)))) AS YF ``` &nbsp; 4.运行结果: A: [阿里云-RDS-MySQL- 5.5.18.1-Alibaba-rds-201406-log] 计算结果:144.43789669025999363208811782 &nbsp; B: [非阿里云-MySQL-5.5~5.6] 计算结果:105.93639914104807268662689486 &nbsp; 这是为什么呢? <br/> 第二部分:测试与分析 &nbsp; 自我测试: &nbsp; 第一步:SQL语句格式化 ``` SELECT ( ((((237803.3300+1659482.4400)/2.00)/1182208.5700)*30.00*6) + ( 0.50 * ( ( (((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6)) - ( ( ( ( (360.00*((1527268.4000-1182208.5700)-((2587.0000-((5354427.3100*0.0400*6)/12.00))+99354.4800+10550.5600))) / ((((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6))*0.5) ) - (0.50*((2587.0000-((5354427.3100*0.0400*6)/12.00))+99354.4800+10550.5600)) ) * (((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6)) ) / 1182208.5700 ) ) - ((((237803.3300+1659482.4400)/2.00)/1182208.5700)*30.00*6) ) ) ) AS YF ``` &nbsp; 第二步:把几个大的语句单独出来执行,在 [阿里云-RDS-MySQL- 5.5.18.1-Alibaba-rds-201406-log] 和 [非阿里云-MySQL-5.5~5.6] 环境里执行,结果都一样 ``` SELECT ((((237803.3300+1659482.4400)/2.00)/1182208.5700)*30.00*6) AS A , (((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6)) AS B , (360.00*((1527268.4000-1182208.5700)-((2587.0000-((5354427.3100*0.0400*6)/12.00))+99354.4800+10550.5600))) AS C , ((((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6))*0.5) AS D , (0.50*((2587.0000-((5354427.3100*0.0400*6)/12.00))+99354.4800+10550.5600)) AS E , (((((1159248.2000+687984.6000)/2.00)/1527268.4000)*30.00*6)+((((457300.0000+1707654.0300)/2.00)/1182208.5700)*30.00*6)) AS F , ((((237803.3300+1659482.4400)/2.00)/1182208.5700)*30.00*6) AS G ``` &nbsp; 第三步:把第二步执行的结果带入到第一步的语句中,在 [阿里云-RDS-MySQL- 5.5.18.1-Alibaba-rds-201406-log] 和 [非阿里云-MySQL-5.5~5.6] 环境里执行,结果还是一样 ``` SELECT ( 144.43789669025999 + ( 0.50 * ( ( 273.67023142422547 - ( ( ( ( 122276281.03200000000000 / 136.835115712112735 ) - 2701.74690000000000 ) * 273.67023142422547 ) / 1182208.5700 ) ) - 144.43789669025999 ) ) ) AS YF ``` &nbsp; 分析: 通过Java, Excel, 和在其它数据库平台计算此公式得出的结果大约是:105.93,所以推测在[阿里云-RDS-MySQL-5.5]数据中执行的结果有问题,以下是本人猜测的几种可能性: 1.应该不是四舍五入和精度的问题。 2.是不是语句解析后优化出的问题? 3.会不会与 [括号导致] 的哪步先算哪步后算有关? 4.会不会与 [乘法结合律规则导致] 的哪步先算哪步后算有关? 5.阿里云-RDS-MySQL-5.5数据库bug,但是MySQL-5.5本身是没有这个问题的? &nbsp; 有哪位高手帮忙看看?

使用SSH开发JavaWeb应用,怎样连接到网络数据库?

如题,我在阿里云上开了一个数据库RDS,在本地开发时配置Hibernate如下: ``` <!-- 数据库连接设置 --> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <!-- 技术:数据库类型:服务器ip/数据库名 --> <property name="connection.url">jdbc:mysql://我的服务器ip地址:3001/mywebset</property> <property name="connection.username">root</property> <property name="connection.password">Li774717903</property> <!-- 配置dialect方言,明确告诉hibernate连接的是哪种数据库 --> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> ``` 端口、数据库名、用户名、密码都是正确的,但是在访问数据库时报错,错误发生在我的HibernateUtil类中: ``` HibernateUtil() { sessionFactory = new Configuration().configure().buildSessionFactory();//此处报错 System.out.println("HibernateUtil : 连接成功"); } ``` 我想知道连接网络上的数据库需要怎样配置? 部分错误信息如下: ``` Type Exception Report Message Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:267) org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:231) org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51) org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94) org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:240) org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352) org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111) org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83) org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418) org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87) org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691) org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726) com.hibernate.dao.HibernateUtil.<init>(HibernateUtil.java:13) com.hibernate.dao.MusicDao.getAll(MusicDao.java:61) com.struts.action.IndexAction.toMusic(IndexAction.java:36) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) ```

mysql安装在阿里云服务器上,要修改mysql配置文件my.cnf,但是进入编辑页面后显示有问题

![图片说明](https://img-ask.csdn.net/upload/201801/31/1517364770_966830.jpg) ![图片说明](https://img-ask.csdn.net/upload/201801/31/1517364648_824403.jpg)

Chrome浏览器操作阿里云的RDS控制台进行手工sql查询很卡

如题,就是别的网页都很正常,但是只要是操作rds的,就会很卡,换别的浏览器没问题,有大佬遇到过吗,感觉应该是设置有问题,但是不知道具体什么影响到 的这个

在PHP应用程序中使用IAM连接到RDS数据库

<div class="post-text" itemprop="text"> <p>I have developed an application using the PHP SDK for AWS. It is hosted on AWS also.</p> <p>I have written a connections file, detailing all the variables and credentials required to connect to the DB, and this works fine.</p> <p>However, in terms of security I was wondering if it is possible to use an IAM Role, as that is what I am using to connect to the EC2 instance, so that I am not explicitly defining the credentials?</p> </div>

Codeigniter:连接到SSL Amazon RDS数据库

<div class="post-text" itemprop="text"> <p>I'm having trouble making a connection to Amazons RDS service from my Codeigniter application.</p> <p>Settings in database config:</p> <pre><code>$db['default']['ssl_set'] = TRUE; $db['default']['ssl_key'] = NULL; $db['default']['ssl_cert'] = NULL; $db['default']['ssl_ca'] = realpath('./application/third_party/mysql-ssl-ca-cert.pem'); $db['default']['ssl_capath'] = NULL; $db['default']['ssl_cipher'] = NULL; </code></pre> <p>However, when I connect. I get the message:</p> <blockquote> <p>Unable to select the specified database: Staging Filename: ...\system\database\DB_driver.php Line Number: 140</p> </blockquote> <p>Line 40 is shown here:</p> <pre><code> // Select the DB... assuming a database name is specified in the config file if ($this-&gt;database != '') { if ( ! $this-&gt;db_select()) { log_message('error', 'Unable to select database: '.$this-&gt;database); if ($this-&gt;db_debug) { $this-&gt;display_error('db_unable_to_select', $this-&gt;database); // LINE 140 } return FALSE; } </code></pre> <p>I made the <a href="https://github.com/mfauveau/codeigniter-reactor/commit/351b4534c36eb1bbde8dfd4157852f137e25b2c7" rel="nofollow">following changes</a> to get <code>mysqli</code> working with SSL:</p> <p>I'm suprised it connected successfully as its complaining about database selection. Not sure where to go from here though?</p> <p>I'm using PHP <code>5.3.8</code> on a windows machine.</p> <h2>Update</h2> <p>This is turning more into a bug than a problem with my implementation. If I set the <code>$db['default']['db_debug']</code> to <code>false</code>. I don't get that problem anymore. However, I get a bunch warnings to do with:</p> <pre><code>Severity: Warning Message: mysqli_real_escape_string() [function.mysqli-real-escape-string]: invalid object or resource mysqli Filename: mysqli/mysqli_driver.php Line Number: 346 </code></pre> <p>Which means there was an unsuccessful connection to the database over SSL.</p> <h2>Update 2</h2> <p>I am using XAMPP.</p> <p>And I am using Codeingiter 2.0.2.</p> <h2>Update 3</h2> <p>My database config file:</p> <pre><code>$db['default']['hostname'] = 'xxxx.us-east-1.rds.amazonaws.com'; $db['default']['username'] = 'xxxxx'; $db['default']['password'] = 'xxxx'; $db['default']['database'] = 'xxxx'; $db['default']['dbdriver'] = 'mysqli'; $db['default']['port'] = 3306; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = true; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; $db['default']['ssl_set'] = true; $db['default']['ssl_key'] = NULL; $db['default']['ssl_cert'] = NULL; $db['default']['ssl_ca'] = realpath('./application/third_party/mysql-ssl-ca-cert.pem'); $db['default']['ssl_capath'] = NULL; $db['default']['ssl_cipher'] = NULL; </code></pre> </div>

可以动态地在AWS RDS中创建数据库吗?

<div class="post-text" itemprop="text"> <p>I am trying to create a new database so that I can transfer my application to AWS without much work. According to this <a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP.rds.html" rel="nofollow">link</a> I should do this to connect to a RDS Database:</p> <pre><code>$link = mysqli_connect($_SERVER['RDS_HOSTNAME'], $_SERVER['RDS_USERNAME'], $_SERVER['RDS_PASSWORD'], $_SERVER['RDS_DB_NAME'], $_SERVER['RDS_PORT']); </code></pre> <p>It works, so I tried adding a new database and made a new connection + query using the new database and it also worked.</p> <p>My question is, the database name from the link, is fetch from <code>$_SERVER['RDS_DB_NAME']</code>, I do not know if there is any <code>AWS</code> dependent thing with them adding the db details to <code>$_SERVER</code> variable.</p> <p>So is it safe if I create a new database <strong>dynamically</strong> using php? I am wondering if tomorrow morning their system will suddenly drop my new database because it was created outside <code>RDS</code>?</p> <p>The AWS Server (EC2, RDS, etc.) were set up by <code>AWS Elastic Beanstalk</code>, I didn't set them up manually so I am having those <code>am I allowed to do this situations</code></p> </div>

java web项目上传到服务器上连不上mysql数据库

项目上传到服务器之后连不上服务器本地的数据库数据库 我的数据库连接代码 public Connection getConnection(){ Connection con=null; try{ final String url="jdbc:mysql://localhost:3306/qulang?characterEncoding=utf-8"; final String user = "root"; final String pwd = "123456"; Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection(url, user, pwd); }catch(Exception e){ e.printStackTrace(); } return con; } 有大神会的吗

使用RDS建立数据库连接AWS Elastic Beanstalk时出错

<div class="post-text" itemprop="text"> <p>I am trying to set up a simple Wordpress site using AWS Elastic Beanstalk with a disconnected RDS database (not part of the ELB instance in case I want to connect multiple sites to the DB) by roughly following this guide: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html</a>.</p> <p>However, I am getting the following error when loading up the Wordpress install:</p> <pre><code>Error establishing a database connection </code></pre> <p>So far I have tried to troubleshoot the issue by:</p> <ol> <li>Verifying that both the RDS and EC2 are on the same VPC with the same security group attached which has the proper inbound rules:</li> </ol> <p><a href="https://i.stack.imgur.com/tOTPA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tOTPA.png" alt="EC2 Security Group Inbound Rules"></a> <a href="https://i.stack.imgur.com/Mv3eq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mv3eq.png" alt="RDS Security Group"></a></p> <ol start="2"> <li>I have verified that the RDS is available like so:</li> </ol> <pre><code>nrb$ nc -zv &lt;***masked-connection-string***&gt; 3306 found 0 associations found 1 connections: 1: flags=82&lt;CONNECTED,PREFERRED&gt; outif en0 src 192.168.20.149 port 58825 dst 3.215.127.182 port 3306 rank info not available TCP aux info available Connection to &lt;***masked-connection-string***&gt; port 3306 [tcp/mysql] succeeded! </code></pre> <ol start="3"> <li><p>I have verified that my EC2 can connect to the RDS by SSHing into it and using the <code>mysql</code> command and copy/pasting my env variables to make sure there were no typos as recommended by @littleforest, which successfully connected to the database.</p></li> <li><p>I have updated the sample PHP application that comes with AWS to output my env variables to make sure that the server is reading them. They outputted as they should.</p></li> </ol> <p>My wp_config.php file looks like as recommeneded by the turtorial:</p> <pre><code>&lt;?php define('DB_NAME', $_SERVER['RDS_DB_NAME']); define('DB_USER', $_SERVER['RDS_USERNAME']); define('DB_PASSWORD', $_SERVER['RDS_PASSWORD']); define('DB_HOST', $_SERVER['RDS_HOSTNAME'] . ':' . $_SERVER['RDS_PORT']); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); define('AUTH_KEY', $_SERVER['AUTH_KEY']); define('SECURE_AUTH_KEY', $_SERVER['SECURE_AUTH_KEY']); define('LOGGED_IN_KEY', $_SERVER['LOGGED_IN_KEY']); define('NONCE_KEY', $_SERVER['NONCE_KEY']); define('AUTH_SALT', $_SERVER['AUTH_SALT']); define('SECURE_AUTH_SALT', $_SERVER['SECURE_AUTH_SALT']); define('LOGGED_IN_SALT', $_SERVER['LOGGED_IN_SALT']); define('NONCE_SALT', $_SERVER['NONCE_SALT']); $table_prefix = 'wp_'; define('WP_DEBUG', false); if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); require_once(ABSPATH . 'wp-settings.php'); </code></pre> <p>And in the config &gt; software of my Elastic Beanstalk, I have verified these variables:</p> <ul> <li>RDS_DB_NAME</li> <li>RDS_HOSTNAME</li> <li>RDS_PASSWORD</li> <li>RDS_PORT</li> <li>RDS_USERNAME</li> </ul> <p>I know there is something stupid that I am missing which an AWS guru is going to catch right away, but this is driving me nuts.</p> </div>

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

抖音上很火的时钟效果

反正,我的抖音没人看,别人都有几十万个赞什么的。 发到CSDN上来,大家交流下~ 主要用到原生态的 JS+CSS3。 具体不解释了,看注释: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Title&lt;/tit...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

推荐9个能让你看一天的网站

分享的这9个保证另你意外的网站,每个都非常实用!非常干货!毫不客气的说,这些网站最少值10万块钱。 利用好这些网站,会让你各方面的技能都得到成长,不说让你走上人生巅峰,但对比现在的你,在眼界、学识、技能方面都有质的飞跃。 一、AIRPANO 传送门:https://www.airpano.com/360photo_list.php 这是一个可以躺在家里,就能环游世界的神奇网站。 世界那么大,绝大多...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

一场疫情,炸出了退休的COBOL程序员

COBOL编程语言,估计大多数程序员从没听说过,我这样的编程老司机,也是只闻其名,从未一睹芳容。出门问了问度娘,答案如下:COBOL语言,是一种面向过程的高级程序设计语言,主要用于数据...

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

讲真,这两款idea插件,能治愈你英语不好的病

时不时就有小伙伴问我,“二哥,能推荐一款 IDE 吗?”你看这话问的,现在搞 Java 的不都在用 Intellij IDEA 吗,还用得着推荐(我已经和 Eclipse 分手了)。然后小伙伴又说,“二哥,IDEA 支持中文吗?我英语不太好。”你看这话问的,搞编程的,英语不好是硬伤啊! 不过,随着 IDEA 最新版(版本号是 2020.1)的发布,英语不好的病可以彻底治愈了。为什么这么说呢?因为 ...

在拼多多上班,是一种什么样的体验?我心态崩了呀!

之前有很多读者咨询我:武哥,在拼多多上班是一种什么样的体验?由于一直很忙,没抽出时间来和大家分享。上周末特地花点时间来写了一篇文章,跟大家分享一下拼多多的日常。 1. 倒时差的作息 可能很多小伙伴都听说了,拼多多加班很严重。这怎么说呢?作息上确实和其他公司有点区别,大家知道 996,那么自然也就能理解拼多多的“11 11 6”了。 所以当很多小伙伴早上出门时,他们是这样的: 我们是这样的: 当...

又一起程序员被抓事件

就在昨天互联网又发生一起让人心酸的程序员犯罪事件,著名的百度不限速下载软件 Pandownload PC 版作者被警方抓获。案件大致是这样的:软件的作者不仅非法盗取用户数据,还在QQ群进...

瑞德西韦重症用药结果再曝光,上百名重症一周内好转,股价大涨19%

郭一璞 发自 凹非寺量子位 报道 | 公众号 QbitAI期盼已久的瑞德西韦临床数据,现在“偷跑”了。在芝加哥大学医学院的临床试验中,125名病人参与,大部分人都已经出院,其中只有2名病...

应聘3万的职位,有必要这么刁难我么。。。沙雕。。。

又一次被面试官带到坑里面了。面试官:springmvc用过么?我:用过啊,经常用呢面试官:springmvc中为什么需要用父子容器?我:嗯。。。没听明白你说的什么。面试官:就是contr...

Vue商城——详情页功能

详情页实现思路 点击商品进去详情页,根据点击请求更加详细的信息,要传过来goodsItem的iid,根据id去服务器请求更加详细的信息;配置路由映射关系,点击进行跳转,带参数传递跳转 itemClick(){ this.$router.push('/detail/'+this.goodsItem.iid) /* this.$router.push({ ...

太狠了,疫情期间面试,一个问题砍了我5000!

疫情期间找工作确实有点难度,想拿到满意的薪资,确实要点实力啊!面试官:Spring中的@Value用过么,介绍一下我:@Value可以标注在字段上面,可以将外部配置文件中的数据,比如可以...

自学编程的 6 个致命误区

嗨,小伙伴们大家好,我是沉默王二。本篇文章来和大家聊聊自学编程中的一些误区——这是我在 B 站上看了羊哥的一期视频后有感而发的文章。因为确实有很多读者也曾私信问过我这些方面的问题,很有代表性,所以我就结合自己的亲身体会来谈一谈,希望对小伙伴们有所启发。 01、追求时髦 所谓基础不牢,地动山摇啊。可很多小伙伴压根就没注意过这个问题,市面上出什么新鲜的技术就想去尝试,结果把自己学的乱七八糟,心灰意冷...

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问