Openshift - Cannot connect to mysql gear - openshift

My app was stuck on connecting to Database gear for almost few day now.
I have tried almost 2 days to search, but it seem no luck.
Could anyone help!
What I have tried:
ssh in to main gear (application gear) is ok, but fail when trying manually connect to mysql.
$mysql
ERROR 2003 (HY000): Can't connect to MySQL server on '559e8e625973cad7d10001b5-jobboardkh.rhcloud.com' (111)
telnet
$telnet 559e8e625973cad7d10001b5-jobboardkh.rhcloud.com 48986
Trying 54.159.182.108...
telnet: connect to address 54.159.182.108: Connection refused
port-forward on my local and I tried to connect as it worked before, but now it's not work
ssh to mysql gear also not able to connect

If you can't ssh into the gear then the gear probably isn't running. Try restarting the MySQL gear via:
rhc cartridge restart -a {appName} -c mysql-5.1

I have waited to get the support from Openshift for several days, but at last I decided to remove out that database gear and recreated it. So all my data was lost.
resolution for preventing database gear is down and data will lost, is to have a daily backup schedule for database and store it in the main gear.

Related

port forwarding to connect to a mysql database on a VPS

I have a mysql database runnnig on 127.0.0.1 on a VPS and now I need to connect to this database I saw that for this I must do a port forwarding in order to expose the mysql service to the internet otherwise I won't be able to connect, I saw here that I can do this connecting via SSH to the VPS and then run the command ssh -L 3306:127.0.0.1:3306 MY_SERVER_IP but I am not sure if this could unset or damage the VPS, this VPS is on production and the developers that created this left the project without finishing it so I have fear of doing a bad configuration and crash the productino server, which could be another way of do this? i.e be able to connect to the database Or is this the safer and correct way?

can not connect to mariadb server using dbeaver

I have installed and running MariaDB server on a raspberry 4. I am trying to connect with Dbeaver but i am unsuccessful.
Hosting db details:
Raspbian: GNU/Linux 10 (buster)
mariadb: Server version: 10.3.34-MariaDB-0+deb10u1 Raspbian 10
Client access:
Dbeaver: Version 22.1.5.202208211008
phpmyadmin
Now as you see, I have installed phpmyadmin as well and I can successfully connect to host. Also I can ssh remote connect.
However Dbeaver refuses to connect and times out.
What I have tried so far:
I have configured mariadb in 50-server.cnf to bind to 0.0.0.0
I have added an admin user account in mysql with all rights and is stated as admin#192.168.1.x, where the ip is the remote pc's ip with the Dbeaver.
I have tried adding also "admin"#"%"
What should I troubleshoot next?
What worked for me, after some tries, was that I went to Dbeaver connection settings/SSH/ and ticked the use SSH tunnel.In Settings I filled the server details and pi user and password.
Testing and connection was successful after some questions/answers about creating a key and a couple of directories.
I wend back to the connection and I was able to expand the connection view tree with Table/Views/etc
I am not sure why I needed the SSH tunnel to connect. It was not stated to any tutorial I used. Maybe someone in the community can help with this.

Connecting sequel pro to docker mysql

I have followed a guid on how to install mysql to docker here.
On running the docker ps I get:
CONTAINER ID IMAGE COMMAND CREATED
3e477bb5aaf9. mcr.microsoft.com/mssql/server:2019-latest "/opt/mssql/bin/perm…" 53 seconds ago
STATUS PORTS NAMES
Up 52 seconds 0.0.0.0:1433->1433/tcp sql_server
I have tried to connect to it from sequel pro like this:
But, that didn't work. I got the connection error message:
Unable to connect to host 127.0.0.1, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL said: Can't connect to MySQL server on '127.0.0.1' (4)
I wonder how can I get connected with Sequel Pro to mysql server on docker?
You've messed up between MySQL and MSSQL. These two are completely different products with incompatible protocols. sequelpro is the tool to connect to MySQL server, while you are running MSSQL. No magic, it can't connect.

Access Lightsail Instance's database with MySQL Workbench

I have an Amazon Lightsail Ubuntu multi WordPress site set up with bitnami stack.
I'm looking for a way to access the Instance's database on Amazon Lightsail with MySQL Workbench remotely.
Please note that I do not have a seperate Lightsail database, as I'm trying to do things as cheaply as possible at the moment. So the following guide is not applicable to me.
Connecting to your MySQL database in Amazon Lightsail
According the wp-config.php MySQL database is using localhost:3306
I have static IP address 3.230.xxx.xxx. I have taken the DB username and password from the wp_config.php file.
I've entered the details.
I wonder if anybody else has managed to connect to an Instance's database, rather than a seperate database.
If this is not possible I wonder if there are any suggestions as how to best access this Instance's database remotely.
Found the answer using a similar youtube video which is used to connect to phpMyAdmin.
https://www.youtube.com/watch?v=9VdcQLDmYII
Basically you need to use Putty SSH tunneling in order to connect to the MySQL instance
First I added a new connection in Putty, make sure port 22 is open on
the LightSail firewall
Go to the Connection -> SSH -> Auth tab on the right hand side menu
Enter your SSH key which is downloaded from the Lightsail dashboard,
it will need to be converted in the standard recognised by putty
Go to Connections -> Data tab on the right hand side menu. Add a new
forwarded port we are forwarding localhost:3306 on the server to a
port on our machine 2222
Start the connection via Putty.
Now in MySQL WorkBench go to the connection to database windows.
Enter the port 2222 I entered the DB user and Password from
wp-config.php file and was able to successfully connect.
Also found a second method
Within the MySQL Workbench you can change the connection method to `Standard TCP/IP over SSH'. Gave the SSH key and the relevant details on connection was accepted
Here is what you need to remotely connect MySQL on Lightsail.
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-connecting-to-your-mysql-database
There are 3 steps:
get the endpoint link
enable public mode
configure MySQL workbench
Yes I have - after a marathon tech support session with AWS :)
Although the Lightsail firewall may say port 3306 is open, the server instance itself may have its own firewall settings which close it. On my case teh AMI that was used to set up the instance was configured that way
I my case it was Ubuntu but here is the summary of the advice I got from AWS--
We have connected to the instance via SSH using the user-name 'xxxxxx' from terminal.
--
ssh -l xxxxx 34.xxx.xxx.221
Checked and confirmed that mysql is running on the instance.
systemctl status mysql
Confirmed the port on which mysql is running.
netstat -plnae | grep 'pid'
Checked the 'ufw' firewall rules and noticed that 3306 is not allowed.
ufw status
Opened the port 3306 on ufw firewall
ufw allow 3306
After performing these steps you were able to establish connection to your database
hth

Invalid argument in ssh_options_set when connect mysql via navicat ssh tunnel

I use navicat ssh tunnel to connect mysql, but I got the error "Invalid argument in ssh_options_set". The remote server is in LAN.
But when I change the server to outer net server, it is fine to connect mysql via ssh tunnel in navicat.
So is there any difference between LAN and outer net when I use SSH tunnel in navicat?I also wonder how can I get the ssh command navicat generate, so I can test it myself.
My environment macos 10.13, navicat version is premium 12.1.10. The settings as show in the picture
BTW, I can use two weeks ago.
1.edit sshd configuration file:
vi /etc/ssh/sshd_config
find:#UseDNS yes
delete comment '#' prefix,change yes to no
UseDNS no
2.restart sshd:
service sshd restart
this resolves my problem, good luck~