AIrflow MySql connection Issues - mysql

I have MySQL and airflow instance both running on docker.
I am trying to test connection using query from "data profiling > adhoc query" options, but I am getting the below error. I have done the connections using "admin > connections"
(2006, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
connection
query
I have connected the above using "localhost" as host i have exposed the mysql port to the hostmachine.
Also i have tried connecting using the IP and port. But it shows the below error.
(2006, "Can't connect to MySQL server on '127.0.0.1' (111)")
Although I can connect postgres instance running in another container without any problems.
I have a workaround to connect to mysql using jdbc mysql drivers but i am curious to see what is this problem.

Related

Cannot connect to local SQL server through socket, using PopSQL in MacOS

I am new to SQL.
I can log into the terminal and create databases.
When I opened PopSQL and tried to connect to localhost, an error message appeared:
Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
I have tried many solutions on Internet but they did not work.

problem in connecting zabbix to remote DB

I installed zabbix 4.0 in centOs 7 and configured it to connect to remote mysql.
But log file says that it can not connect to DB.
I tried to telnet to DB machine and I was OK!
telnet 10.1.13.33 3306
Trying 10.1.13.33...
Connected to 10.1.13.33.
here is my /etc/zabbix/zabbix_server.conf:
SourceIP=10.1.9.140
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
DebugLevel=5
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBHost=10.1.13.33
DBName=zabbix
DBUser=zabbix
DBPassword=******************
DBPort=3306
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
When starting zabbix, in /var/log/zabbix/zabbix_server.log there is a line like this:
[Z3001] connection to database 'zabbix' failed: [2003] Can't connect to MySQL server on '10.1.13.33' (13)
database is down: reconnecting in 10 seconds
By default, Zabbix server does not understand which IP to be listened. So you have to also mention your ListenIP in /etc/zabbix/zabbix_server.conf:
ListenIP=<your_ip>

Problems connecting Laravel to a remote MySQL database: "Lost connection to MySQL server at handshake" and "MySQL server has gone away"

I got this problem where I have developed a Laravel application which uses or connects to a external database.
I have copied all Laravel files in a CentOS server that needs to connect to a MySQL database that is located in another (Ubuntu) server.
Locally, I didn't have any trouble with Laravel Homestead.
But now the Laravel app throws the following error:
SQLSTATE[HY000] [2006] MySQL server has gone away
And if I try to connect to the external database from the CentOS terminal,
$ mysql -h xxx.xxx.xxx.xxx -P 3306 -u user4laravel -p
I get this other error:
ERROR 2013 (HY000): Lost connection to MySQL server at 'handshake:
reading inital communication packet', system error: 11
Notes: I connect to that server via SSH Tunnel with SSH-KEY and passphrase. Do I have to create a tunnel connection?
How do I make it persistent? Is this practical? Or ...
Does anybody know how to solve this or a workaround?

Connect to SQL server with custom port while executing installer

I have InstallShield 2013 basic MSI project. During installer execution I need to connect to MySQL Server which is running on 3310 port. Default port is 3306 and installation runs successfully, but when I try to connect to server with different port - installer cannot connect to MySQL server.
I tried to set custom port like described here
ServerName,3310
But it didn't work for me. I also tried to connect by IP of server and port delimited with ":" but it also had no effect.
When I try to connect to server by typing hostname I get this error: "Can't connect to MySQL server on 'hostname'"
When I try to connect to MySQL server by typing hostname,port I get the following error: "Unknown MySQL server host 'hostname,port'"
Can anyone tell me what I am doing wrong or what I need to do to connect to MySQL server with custom port?

phpmyadmin and mysql socket error

once i try to connect to mysql on phpmyadmin in ubuntu i got this error
2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
but with mysql query browser i connect with out any error and it works
why phpmyadmin does not connect?
The command line client uses a unix domain socket while PHPmsyqladmin uses a network socket. You'll need to enable the network socket in the mysql config, most likely.
EDIT:
You can read about some of the troubleshooting (and windows) side of this: http://dev.mysql.com/doc/refman/5.1/en/can-not-connect-to-server.html
And here is how to set up mysql to use a network config:
http://www.howtogeek.com/howto/mysql/switch-mysql-to-listen-on-tcp/