Configure database in phpstorm for a laravel project - database

I'm working on a iMac (Sierra) with phpstorm & Vagrant box laravel/homestead
I try to configure the database in the IDE but each time it failed and it said, an idea?
Connection to cmsineria#localhost failed: SSH: java.net.ConnectException: Connection refused.
SSH: java.net.ConnectException: Connection refused

I had the same issue on my Macbook Air Sierra using MAMP.
By default, MAMP use port 8889 for MySQL. Try to change port 3306 to 8889 in General.

Related

Unable to connect to SQL Server from Docker container (Linux image)

In our application we are using linux based container which access SQL server installed on VM. Everything works fine in local environment outside the container, But when I ran the app in local container we are getting the below error.
"A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught"
appsetings.json
"ConnectionStrings": {
"DbConnection": "Server=tcp:vmname\\sqlservername,49763;Database=dbname;User ID=username_Users;Password=pwd;MultipleActiveResultSets=true;Integrated Security=False;"
}
Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
.......
Any inputs will be appreciated
The issue was related to TLS version of the SQL server, enabling TLS 1.2 resolved the issue
Please add ;TrustServerCertificate=true to your connection string.

Symfony 2 SQLSTATE Connection refused

I have a problem with connecting my database online.
My site is hosted on one server, and connects to a remote database that is on another server.
But it sends me the following error:
SQLSTATE [HY000] [2002] Connection refused Error
I did, however, put the exact connection information .. I do not understand why the connection is refused ..
parameters.yml:
parameters:
database_host: **.**.**.**
database_port: 3306
database_name: zip
database_driver: pdo_mysql
database_user: root
database_password: null
mailer_transport: smtp
mailer_host:
mailer_user:
mailer_password:
secret: d87fdb6ecf4089df33360b187388e33c34e12f85
I thank you in advance
Make sure the user/password are the right ones. You can use the mysql command line cli to try to connect.

JEE application in Docker accessing local DB port

I am trying to deploy a JEE application in Docker container. The application requires embedded apache derby on port 1527. It works fine when run in regular dev environment. However, when I run inside a Docker container, the connection on port 1527 is refused.
Things to note, I am using 'default' db connection. That means the application is trying to access the database on localhost:1527. Following is the error message:
java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused (Connection refused).
I am wondering what does localhost mean within a Docker container, the host server or the container?
Any suggestions to fix it?

Jackrabbit MSSQL database repository

Any specific reason why abruptly connection to MSSQL server is lost. I am running web application on the same machine so network connectivity issues are out of question. My application uses Jackrabbit configured to store content with MSSQL. Application is running on Wildfly v9 with JAVA_HOME set to jdk1.8 and I have verified that wildfly is picking it up as well. Also, sqljdbc4-3.0.jar is available to wildfly modules with proper driver configuration in standalone. I am baffled as to why jdk7 adapter would be called to manage connection. However, interesting observation is that this does not occur with Wildfly 10.
standalone.xml
<driver name="sqlserver" module="com.microsoft.sqlserver">
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
</driver>
exception:
ERROR 21-07 16:41:13,636 (DbUtility.java:logException:92) failed to close ResultSet
ERROR 21-07 16:41:13,637 (DbUtility.java:logException:94) Reason: IJ031040: Connection is not associated with a managed connection: org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7#386eff84
ERROR 21-07 16:41:13,639 (DbUtility.java:logException:95) State/Code: null/0

not attempt to authenticate using SASL (unknown error)

I am trying to setup zookeeper on ec2 two instances. as given here and here.
I am trying to run zookeeper which fails with an error:
command: bin/zkCli.sh -server localhost:2181
> 2015-03-15 00:22:35,644 [myid:] - INFO [main:ZooKeeper#438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher#3ff0efca
Welcome to ZooKeeper!
2015-03-15 00:22:35,671 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread#975] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2015-03-15 00:22:35,677 [myid:] - WARN [main-SendThread(localhost:2181):ClientCnxn$SendThread#1102] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
[zk: localhost:2181(CONNECTING) 0] 2015-03-15 00:22:36,796 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread#975] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2015-03-15 00:22:36,797 [myid:] - WARN [main-SendThread(localhost:2181):ClientCnxn$SendThread#1102] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
zoo.cfg as bellow
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/lib/zookeeper
clientPort=2181
server.1=localhost:2888:3888
server.2=<My ec2 private IPs>:2889:3889
also I have created myId file as on both ec2 instances - /var/lib/zookeeper/myid
I also tried to edit /ect/hosts file but still facing the same issue.
also how I can start both of the zookeeper instances by 1 command?
Note: Server get started successfully if I tried with bin/zkCli.sh start command.
Thanks in advance!
look zk log zookeeper.out,if there have connection limit error, configure the following to zoo.cfg.
# the maximum number of client connections.
# increase this if you need to handle more clients
maxClientCnxns=60
This is temporary error , for mine after some time , It gone away :-
This is my zoo.conf file ::-
Dir=../data
clientPort=2181
tickTime=2000
initLimit=5
This error occurred when I forgot to run% ZOOKEEPER_HOME% \ bin \ zkserver.cmd
By running, the problem has been resolved.
Correct this property on the server.properties
default would be localhost change it to match the zookeeper server starup ip and port
zookeeper.connect=0.0.0.0:2181

Resources