Unable to establish SSL connection upon wget on Ubuntu 20.04 LTS - mysql

I use browserSetup.sh to install ucsc Genome Browser in the Cloud (GBiC) program, and getting the error
--2021-08-26 13:43:10-- https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
Unable to establish SSL connection.
I checked this script, there may be an error in this line
wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -P /usr/include/mysql/
I ran this line of code and got the same error,So i want to understand why Unable to establish SSL connection when I use wget.
I ping raw.githubusercontent.com and return
64 bytes from cdn-185-199-109-133.github.com (185.199.109.133): icmp_seq=1 ttl=45 time=87.8 ms
64 bytes from cdn-185-199-109-133.github.com (185.199.109.133): icmp_seq=2 ttl=45 time=57.9 ms
64 bytes from cdn-185-199-109-133.github.com (185.199.109.133): icmp_seq=3 ttl=45 time=57.9 ms
And I tried to use the --no-check-certificate parameter but still can't solve the error,How do i need to solve this problem?

Related

Allowed memory size exhausted after switching PHP from 7.1 to 7.2

Previously, my site runs on PHP 7.1 on Ubuntu 14.04 LTS and upgraded to Ubuntu 16.04. After upgrade, I can still access my site.
Then I install and switch to PHP 7.2 (I didn't remove PHP 7.1, only disable it). When accessing, it shows laravel error about database connection error. Then I enable mysql and pdo_mysql in /etc/php/7.2/cli/php.ini. After that, my site only return 500 internal server error.
I checked /var/log/apache2/error.log and it says
[Tue Dec 17 11:12:36.773684 2019] [php7:error] [pid 27730] [client xxx.xxx.xxx.xxx:y] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 31
The memory_limit in /etc/php/7.2/cli/php.ini is already -1 from start.
You probably have multiple configuration files for the different PHP interfaces.
You have edited the cli configuration.
To check, which configuration you are using with the apache2 sapi, you can create a test.php in your document root like below
test.php
<?php
phpinfo();
Then open test.php in your web browser.
There is a row labeled „loaded configuration file“
Edit the configuration, I don’t recommend to set the memory limit to -1 (not limited by php) for websites. Choose a value that suits your requirements. It should be a multiple of 128MB.
Restart Apache after changing the value.
Remove the test.php when you’re done.
Two more things on Ubuntu and Apache:
Choose system default php version like so
update-alternatives --set php /usr/bin/php7.2
Choose Apache php version like so
a2enmod php7.2
systemctl restart apache2

PhpStorm + Xdebug + VMware VM = Time-out connecting to client

My Debian server (a VMware virtual machine) is up and running and all the settings in my PhpStorm are ok. I've set the virtual machine network adapter as bridged (also tried NAT).
My xdebug.ini looks like this:
zend_extension=xdebug.so
xdebug.profiler_enable=On
xdebug.remote_enable=On
xdebug.remote_host=MY_HOST_IP_ADDRESS
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_log="/tmp/xdebug.log"
Still, my xdebug.log looks pretty angry:
Log opened at 2018-07-01 14:54:08
I: Connecting to configured address/port: MY_HOST_IP_ADDRESS:9000.
E: Time-out connecting to client. :-(
Log closed at 2018-07-01 14:54:09
In fact, when I use telnet from my guest machine...
telnet MY_HOST_IP_ADDRESS 9000
Trying MY_HOST_IP_ADDRESS...
telnet: Unable to connect to remote host: Connection refused
I can't really get how to make this work after a couple of days. My SSH tunnel is also up and running (I've used the built in PhpStorm SSH tool), but even netcat doesn't help me out:
nc MY_HOST_IP_ADDRESS 9000
(UNKNOWN) [MY_HOST_IP_ADDRESS] 9000 (?) : Connection refused
This is my PhpStorm configuration (as you can see, the validation script looks good):
What am I missing?

Import MySQL data to Excel 365

I'm trying to import data from a MySQL Database to an Excel 365 (32 bit) Workbook.
This is a DB I can link to without any issues :
This is the DB I can't link to :
I've downloaded the following connector :
MySQL Connector Net 6.10.6
I suspect that this is not the correct connector for the second DB.
The error is this :
[MySQL: Unable to connect to any of the specified MySQL hosts.]
Could someone point me to the beginning of a solution ?
I've also tried to connect via VBA but I also get an error which must be due to the same causes as above.
If the database server and the database client (Excel) are running on different machines then they cannot communicate via UNIX filesystem sockets.
If you specify localhost as the target host in a libmysql client, then the client will try to connect via the (Unix) filesystem socket.
On the other hand, if you instead specify 127.0.0.1, it will use a TCP socket.
More Information:
Stack Overflow : How to connect to database when server is in Unix socket? (MySQL/PHP)
Wikipedia: Localhost
Wikipedia : Unix domain socket
Wikipedia : TCP Socket definition
MySQL.com : Configuring a Connector/ODBC DSN on Windows with the ODBC Data Source Administrator GUI
EDIT:
In response to your comment, the target host would be specified in the location specified on this page, or it can also be installed via command line with these steps.
Also you might find this helpful:
mysql.com : Using Connector/ODBC with Microsoft Word or Excel
mysql.com : Using Connector/ODBC with Microsoft Access
Setting up a MySQL ODBC DSN on Windows 7 64-bit:
I have a faint recollection of the last time I setup an ODBC DSN to MySQL.
It was a while ago so I might be mistaken on the details but I'm pretty sure that the only was I was able to get it working on a 64-bit system (possibly because the server was 32-bit?) was to install both the 32-bit and 64-bit drivers (from here) into separate folders, rebooting between each install. As I recall, it took a dozen install/uninstalls before I got it right.
Once it was properly installed, I had to administer it with Window's 32-bit version of ODBC Administrator.
There's 2 versions of ODBC Administrator (aka 'Data Sources'), confusingly:
My 64-bit version is located at : c:\windows\system32\odbcad32.exe
My 32-bit version is located at : c:\windows\SysWOW64\odbcad32.exe
Note that much of this is from memory and unverified!
I have this text file sitting in my "mySQL Notes" folder, so I gather I ended up using the command line to get it installed:
myodbc-installer -s -a -c1 -n " mysqlDSN " -t "DRIVER=MySQL ODBC 5.3 Unicode Driver;SERVER= (server name) ;DATABASE= (database name) ;UID= (user name) ;PWD= (password) "
In my case I was setting up connection to a web host server, so I referred to my CPanel for the server / database / uid values.
...and as I recall, I had to run it from the location of the 32-but version of the myodbc-installer. Also, you'll have an ODBC.INI text file somewhere showing the configuration.
More detail under the plethora of information here:
mysql.com : MySQL Connector/ODBC Developer Guide

phpmyadmin CSV import memory issues

We use a central phpMyAdmin instance to manage many remote mysql servers. One of the developers has come to me with an issue with importing a CSV in to mysqld database using phpMyAdmin import tools since updating phpMyAdmin to 4.0.9.
Here's the details: -
phpMyAdmin Version information: 4.0.9deb1.lucid~ppa.1 is used to centrally manage a number mysql instances including the developers Developer VM's
MySQL Database: /usr/libexec/mysqld Ver 5.5.36 for Linux on x86_64 (remote host)
Apache2:
Server version: Apache/2.2.14 (Ubuntu)
Server built: Feb 14 2012 16:42:25
PHP:
PHP 5.3.2-1ubuntu4.19
CSV file sample in this case is 2.75MB in size.
I started with the default php.ini memory limit 10MB which I end up increasing out to 256MB while debugging this issue. When memory_limit was less that 128MB or less the following error message was received:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 203461 bytes) in /usr/share/phpmyadmin/libraries/plugins/import/ImportCsv.class.php on line 473
I managed to get around this part of the problem after increasing this too 256MB the error changed to
Exceeds Max Allowed Packet for MySQL
I believe I have localised the issue to phpMyAdmin by performing a LOAD DATA IN FILE from the terminal manually importing data from mysql CLI using the same SOURCE and TARGET hosts there was no problem and data is import correctly.
if we use phpMyAdmin on the localhost of the mysql server (Version information: 4.1.11) I got a different problem with message stating the database has gone away which I have put down to query taking too long to run for similar reasons.
I guess what I am thrown by is "How the hell does a 2.75MB CSV manage to balloon out to just under 256MB when handled by phpMyAdmin"? Memory leak perhaps?
I have a good look around on the internet and am struggling to come up with some decent answers here.
Perhaps in need to log a bug with phpMyAdmin?????
Has any one else encountered this problem and have a solution?

ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0

I am getting the following error
ERROR 2013 (HY000): Lost connection to MySQL server at
'reading authorization packet', system error: 0
when trying to connect to my MySQL server.
What I am doing:
I have Master - Slave replication in MySQL that is working and just added load balance capabilities using F5.
I have configured the F5 according to their site.
But when I am trying to connect to my MySQL server using the IP that the F5 was configured with I get
ERROR 2013 (HY000): Lost connection to MySQL server at
'reading authorization packet', system error: 0
Any ideas?
Update on my progress : ZERO
- i am getting the same error
I get no entries in the /var/log/secure as if somebody would try to authenticate coming form the ip where i had created my load balance server.
No enties in the mysql error log.
The command - returns nothing
mysql> SHOW GLOBAL STATUS LIKE 'Aborted_connections';
Empty set (0.00 sec)
I've already altered my my.cnf file and add the
[mysqld]
skip-name-resolve
Alterd the connect_timeout to 10.
So it seems i get no response for the server i have created on my F5
I finally convinced the F5 admin to pass me the log for the F5 server and i have exctraced all i need form it.
Here is the output :
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_ACCEPTED>: BIG-IP MySQL Proxy -- clientside initial connection
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_ACCEPTED>: BIG-IP MySQL Proxy -- clientside responding with server WELCOME packet
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_DATA>: BIG-IP MySQL Proxy -- clientside authenticated flag not set
Jan 28 15:46:39 tmm err tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_DATA>: BIG-IP MySQL Proxy -- mysql client: attempting to do something before authentication
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <LB_SELECTED>: BIG-IP MySQL Proxy -- serverside selected pool /Common/foss-mysql-slave_pool node SLAVE-IP
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_CLOSED>: BIG-IP MySQL Proxy -- clientside connection closed from MASTER-IP(XXXXXXX)
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <SERVER_CLOSED>: BIG-IP MySQL Proxy -- serverside connection closed from node SLAVE-IP(XXXXXXXX)
I've replaced the ip for security sake !
just as an extra - and i think is here the problem - my mysql version is 5.1.69-log
Thx All
From documentation:
More rarely, it can happen when the client is attempting the initial
connection to the server. In this case, if your connect_timeout value
is set to only a few seconds, you may be able to resolve the problem
by increasing it to ten seconds, perhaps more if you have a very long
distance or slow connection. You can determine whether you are
experiencing this more uncommon cause by using SHOW STATUS LIKE
'aborted_connections'. It will increase by one for each initial
connection attempt that the server aborts. You may see “reading
authorization packet” as part of the error message; if so, that also
suggests that this is the solution that you need.
Try increasing connect_timeout in your my.cnf file
Another style:
MySQL: Lost connection to MySQL server at 'reading initial communication packet'
At some point, it was impossible for remote clients to connect to
the MySQL server.
The client (some application on a Windows platform) gave a vague
description like Connection unexpectedly terminated.
When remotely logging in with the MySQL client the following error
appeared:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
On FreeBSD this happens because there was no match found in /etc/hosts.allow. Adding the following line before the line saying ALL:ALL fixes this:
mysqld: ALL: allow
On non-FreeBSD Unix systems, it is worth to check the files /etc/hosts.allow and /etc/hosts.deny. If you are restricting connections, make sure this line is in /etc/hosts.allow:
mysqld: ALL
or check if the host is listed in /etc/hosts.deny.
In Arch Linux, a similar line can be added to /etc/hosts.allow:
mysqld: ALL
This is usually caused by an aborted connect. You can verify this by checking the status:
mysql> SHOW GLOBAL STATUS LIKE 'Aborted_connects';
If this counter keeps increasing as you get the lost connections, that's a sign you're having a problem during connect.
One remedy that seems to work in many cases is to increase the timeout. A suggested value is 10 seconds:
mysql> SET GLOBAL connect_timeout = 10;
Another common cause of connect timeouts is the reverse-DNS lookup that is necessary when authenticating clients. It is recommended to run MySQL with the config variable in my.cnf:
[mysqld]
skip-name-resolve
This means that your GRANT statements need to be based on IP address rather than hostname.
I also found this report from 2012 at the f5.com site (now protected by login, but I got it through Google cache)
It is likely the proxy will not work unless you are running BIG-IP 11.1 and MySQL 5.1, which were the versions I tested against. The MySQL protocol has a habit of changing.
I suggest you contact F5 Support and confirm that you are using a supported combination of versions.
I've struggled a lot with this error. Tried every single answer I found on the internet.
In the end, I've connected my computer to my cell phone's hotspot and everything worked. I turned out that my company's internet was blocking the connection with MySQL.
This is not a complete solution, but maybe someone faces the same problem. It worths to check the connection.
I solved this by stopping mysql several times.
$ mysql.server stop
Shutting down MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/xxx.local.pid).
$ mysql.server stop
Shutting down MySQL
.. SUCCESS!
$ mysql.server stop
ERROR! MySQL server PID file could not be found! (note: this is good)
$ mysql.server start
All good from here. I suspect mysql had been started more than once.
My case was that the server didn't accept the connection from this IP. The server is a SQL server from Google Apps Engine, and you have to configure allowed remote hosts that can connect to the server.
Adding the (new) host to the GAE admin page solved the issue.
I have a mac but would assume all linux are the same for this part...
In my case I got this:
2018-12-03 11:13:27 - Start server:
2018-12-03 11:13:27 - Server start done.
2018-12-03 11:13:27 - Checking server status...
2018-12-03 11:13:27 - Trying to connect to MySQL...
2018-12-03 11:13:27 - Lost connection to MySQL server at 'reading authorization packet', system error: 0 (2013)
2018-12-03 11:13:27 - Assuming server is not running
I ran this:
sudo killall mysqld
And then started the mysql again through mysqlworkbench although in your case it might be like this:
mysql.server start
*sidenote: I tried running mysql.server stop and got this Shutting down MySQL
.... SUCCESS! but after running ps aux | grep mysql I saw that it hasn't really shut down...
I use several mysql connections (connecting to different sets of databases) in localhost.
This happened to me after I shut my computer down and mysql was not properly shutdown. After starting my machine I was able to successfully connect to multiple db connections except one (I used this a lot before my machine shutdown).
As per the instructions in this posts I doubled connect_timeout but I was not able to connect to that one database connection.
I restarted my machine and i can successfully connect now. This will help you unblock yourself but it'd be great if it can be fixed without restarting the machine.
Another concern is: connection_timeout seemed to me delay related problem but I was getting the error immediately in localhost when there is no network in the equation.
In my case, it happened when there were a lot of connection to the MySQL server (15,000 connections) and the free memory was about 120M . After I added more memory to the server, the error was gone.
I scratched my head about this error for 3 days. I tried tweaking permissions on the database, new users from different IPs in the Users table, adjusting the bind-address in a bunch of different ways, comparing my my.cnf file to a known working server, firewall changes, upstream firewall changes, hosts.allow/deny...none of them worked.
Then I looked not at mysql/error.log (which came up empty) but my journalctl -xe log and low and behold, it couldn't read my /etc/hosts.allow and my /etc/hosts.deny file.
chmod 644 hosts.allow
chmod 644 hosts.deny.
All better now.
Another possibility can be connection reset from the TCP wrappers (/etc/hosts.deny and /etc/hosts.allow). Just check what is coming in from the telnet to port 3306 - if it is nothing, then there is something is in the middle preventing communication from happening.
I've created my account just to add this bit of information to this old question, because nowhere on the web I found any reference to the cause of my problem which I eventually found.
(Adding it here cause this is the top google result, also when adding PHP as search term)
In PHP 7.4 when you fork a process (I know, who does this??) that has an active MySQL connection, the connection will get messed up and spit out the OP's error.
just reinitialize/recreate the connection in each forked process after the forking, this will fix it.
Hope it this helps anybody.
I got both errors: mostly reading initial communication packet and reading authorization packet one time. It seems random, but sometimes I was able to establish a connection after reboots, but after some time the error creeped back.
Avoiding the 5GHz WiFi in the client seems to have fixed the issue. That's what worked for me (server was always connected to 2.4GHz).
I tried everything from server versions, odbc connector versions, firewall settings, installing some windows update (and then uninstalling them), some of the answers posted here, etc... lost my entire sleep time for today. Super tired day awaits me.
If you get this when using DevDesktop - just restart DevDesktop!