The difference between MySQL Workbench and MySQL client - connection

I have installed both MySQL Workbench and MySQL client console (Using Ubuntu WSL).
When I tried to connect to MySQL Server and query.
The MySQL Workbench returns typically but the MySQL client returns with errors:
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 56993
Current database: *** NONE ***
I don't know the difference between the 2 versions. How can I config MySQL client to Query regularly like MySQL Workbench?
NOTE: It's the same issue when I use mysql-connector-python.

Related

How to resolve `SSL SYSCALL Error` with a PostgreSQL Database on Azure?

After restarting my PostgreSQL on Azure Database Instance, I can no longer connect via any client and I receive: psql: SSL SYSCALL error: EOF detected with psql.
I used the Restart button on the Azure Database for PostgreSQL server overview page.
Most likely server was in the process of rebooting. Check in the server logs server start time. Probably it will be after you issues your connection request. If you have heavy workload running then recovery is expected to take longer.

MySQL remote server connection failed w Navicat

I am trying to connect to a MySQL remote server. I was able to connect prior to moving my internet service to Suddenlink.
I am now getting the error:
2003 - Can't connect to MySQL server on 'www.server.com' (10038)
I have added my new IP address to Remote MySQL.
Any suggestions as to what may be going on?
Thanks!

How to connect my Rails App to SQL Server from Ubuntu Guest to Windows 8.1 Host?

I'm having issues setting up my rails app on a Windows 8.1 machine with Ubuntu through VirtualBox. I've done the following in attempts to try and connect my Ubuntu Guest Rails app to my Windows 8.1 SQL Server Express database.
Setup a Bridged Connection on my Virtual Box network adapter
I've installed my rails application and freetds on my ubuntu guest.
In SQL Server Configuration Manager I enabled TCP/IP under SQL Server Network Configuration
I also setup the correct login users for my database after creating it.
I am able to run my rails application on ubuntu with rails s and it runs fine. When I try to access it from my windows host or ubuntu guest it originally shows a GET until it finally errors and presents me with this message Unable to connect: Adaptive Server is unavailable or does not exist. I'm unsure what to try next. I was looking for a way to test the connection to the database outside of rails in just terminal to see if I could get a connection first but my attempts so far haven't produced anything. Below is my database.yml. The ip address I'm using is the ip address I get for windows host.
development:
adapter: sqlserver
dataserver: 192.168.1.114:1433
host: 192.168.1.114
port: 1433
database: borneo
username: marvin
password: my_password
pool: 5
timeout: 5000
So I found a solution. After I had turned off the firewall I assumed that the firewall wouldn't be blocking anymore traffic; however, seems that I didn't turn it off properly I guess. The following method solved my problem.
Go to Windows Firewall and Advanced Security
Create an Inbound Rule for the Ubuntu Guest ip address for port 1433 using TCP.
After I did that it worked.

Ruby on Rails Set up MS SQL Connection to remote Database in database.yml

I want to connect my Ruby On Rails Application ( developed with ruby mine ) with a MS SQL Server 2008 R2 running on an external PC.
I can connect with Microsoft SQL Server Management Studio running on the same PC where Ruby mine is running to the remote Database in this way:
Server name is: domain.de,PORT\SQLServerName
Then I am connected to this remote database :
In rubymine I use the Gems:
Now I can use adapter: sqlserver in the database.yml without an error.
But I have no clue how to connect to the remote database:
I tired several example configurations like:
When I run the app in development mode I get this error:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/tiny_tds-0.6.1-x86-mingw32/lib/tiny_tds/client.rb:77:in `connect': Server name not found in configuration files (TinyTds::Error)
Can Anybody help me with the syntax for the database.yml that it can use the input data I
also use to connect with MS SQL Server Management Studio to the remote Database
I fixed it on myself:
Just replace the comma with a double point
dataserver: 'domain.de:50021\xxxxxxSQLServer'
DAMN YOU WINDOWS

Permission denied running ActiveRecord gem tests in PostgreSQL

I'm having trouble running the ActiveRecord gem tests in PostgreSQL and am getting the following error:
rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:1473:in `initialize': could not connect to server: Permission denied (PG::Error)
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
I'm able to connect to the server using psql -h localhost and create databases, etc. I'm using http://postgresapp.com/ for the postgresql server. I get the same error when running rake postgresql:build_databases as suggested by the Rails contributing guide.
The rails/activerecord/test/config.yml file has the following settings (all I've changed is the username):
postgresql:
arunit:
username: pete
min_messages: warning
arunit2:
min_messages: warning
username: pete
Is there another setting I need to configure in config.yml? I've tried specifying a host and empty password, but that doesn't help at all.
Your psql is connecting using TCP to localhost, ruby is obviously connecting through a local unix domain socket. Problem with the unix domain socket of postgresql on osx is that not all psql client libraries and database backends agree on the location of the socket.
If you don't pass a -h option to psql it will use a local unix domain socket to. There is a good change it will fail to.
There are two possible solutions for both of which I can't give you details because I do not know ruby on rails and don't have access to a mac right now:
Tell ruby to connect to localhost instead of using the unix domain socket.
Make sure the client library (libpq) used by ruby matches the backend you are running.

Resources