MacOS MySQL Gone Away and local networking issues due to GateKeeper - mysql

On MacOS Mojave 10.14.5, local services relying on TCP connections have connections randomly aborted, resulting in errors like "Mysql has gone away" and Nginx connection resets.
Seems like the Mojave OS is monitoring and blocking TCP connections, even if the firewall is disabled.
I managed to get MySQL working in a docker image, however this is much slower than native MySQL service. Same applies to NGinx.
A lot of blog articles online cover this issue with MySQL, recommending to increase wait_timeout and max_packet_size, which does not work in this case as the issue is most likely not with MySQL itself (in fact, local Nginx seems also to be affected).
Just spent 2.7K on a brand new MacBookPro and feel like I can't work with it...
Any help?

Chatted with Apple Support, who recommended to do an SMC reset, which I have done twice and it did not help... They don't really offer support for the OS issues... Was about to return the MacBookPro and buy a Linux laptop...
... and then figured it out!!!
As part of installation instructions for a third-party VPN software, I have been asked to run the following command on my MacOS Mojave 10.14.5:
sudo spctl --master-disable
This was to allow ALL applications to be installed on the system, bypassing System > Privacy settings (adding a third option "Allow all"), basically working around the GateKeeper service to allow for the VPN app to install.
This was meant to be disabling GateKeeper, so it won't interfere with the application, however it looks like GateKeeper is still doing something shady, and actually causing the networking issues.
Anyway, it was enough to switch it back and restart the MacBook:
sudo spctl --master-enable
in Terminal and reboot.

Related

QEMU on macOS big sur: connect to guest from the host without port forwarding

I'm having a hard time finding a solution to access my Linux guest system running on QEMU from my macOS Big Sur host.
The only solution I've found that works is port forwarding (using e.g. -net user,hostfwd=tcp::2200-:22 for SSH). This works, but is not convenient since I need to forward all the ports I need to use, and I would like to be able to use scripts, applications, etc. without having to tweak the ports everywhere.
So having an IP to connect from the host to the guest would be best, but surprisingly I couldn't find an easy to do so.
I was trying to achieve a similar setup and the approved answer was a big help.
By using QEMU 7.1+ you can make use of Appleā€™s VMNET framework for networking with VMs without port forwarding.
QEMU makes use of this with -netdev vmnet-shared / vmnet-bridged / vmnet-host
More detail can be found on the man page man qemu-system-aarch64
I have a short summary here: https://gist.github.com/max-i-mil/f44e8e6f2416d88055fc2d0f36c6173b
The only articles I found online related to this seem to be valid only for older versions of macOS.
Looks like newer versions of macOS have a new mechanism for this, called vmnet.
And a patch for QEMU was implemented recently: https://gitlab.com/qemu-project/qemu/-/issues/465
With this patch, using -nic vmnet-host makes the guest accessible from the host (on an interface called bridge100).
At the moment, the latest stable release of QEMU (7.0.0) doesn't include this patch, but it's possible with brew to build the latest HEAD from git, which includes this change (but can't be considered stable!), using brew install qemu --HEAD.
Afterwards, make sure to use the correct qemu binary, by updating your PATH env variable or executing the binary with full path directly. Should be something like this: /usr/local/Cellar/qemu/HEAD-7077fcb/bin/
socket_vmnet might solve your problem
https://github.com/lima-vm/socket_vmnet
As Lima claims
The guest IP is assigned by the DHCP server provided by macOS. The guest is accessible to the internet, and the guest IP is accessible from the host.

MAMP Pro 5.1.1-terminates MySQL when quitting

I updated to Mac OS Mojave and started experiencing this. If I logout of my machine it quits all running apps. MySQL gets quit in the process. Never did before. The Apache and DNS services of MAMP do not quit. Just MySQL.
Mostly I don't bother with MAMP, it just runs. It starts when my machine starts at 7am EST and runs until shutdown at 11pm EST. I have clients that access my development sites. So people started complaining.
I have come to this conclusion that I cannot logout once my machine starts. Ever. Or MySQL quits and my sites are not accessible. I do have my user preference set to lock my screen after 1 hour of inactivity. That does not quit any apps. That works.
If for some reason I want to inspect the MAMP app for setup or config settings to dismiss it I must go to it's icon in the dock, right-click, and choose Hide.
If I want to leave my office and want my machine secure I have to let lock itself up after the prescribed amount of time. If I choose Sleep that too with quit MySQL.
I don't know if this is an issue I can fix by tweaking the settings of either the OS or MAMP or if this is a "bug" of somekind.
Thanks.
Duane Mitchell
After updating Mac OS from 10.14.0 to 10.14.1 the issue has ceased to be a problem.

Xampp doesn't work on Mac X

So here is what happens when i run xampp by clicking on the manager-osx.
I click on "manager-osx".
Icon jumps in the dock as if it is starting the service.
Asks for admin password. I enter the password.
It accepts the password, and application keep jumping in the docs for 3-4 times.
The app disappear from the dock.
The issue started after i have quit few processes from the activity monitor.
I am not sure what has affected xampp and can't remember what services i have stopped as there were many.
Solution applied so far:
Restarted my MacBook Pro.
Exit all other application and tried to run xampp.
Made sure no other application is running on port 80.
Removed xampp from applications and tried to reinstalled. Same issue with re-installation process, It asks for admin password and then nothing happens.
search online for any help but nothing helpful found.
I haven't got any experience with XAMMP but MAMP works always fine for me. MAMP has everything I need in terms of functionality.
I would recommend MAMP
If MAMP is not the best solution for you. You can install manualy
APACHE + PHP + MYSQL (It's not so hard)
Just go step by step using tutorial like
This
Manual installation will give you much more controll on your enviroment.
And also you will have better output to attach it here if you can't find a problems.
Of course it's little bit longer than 3 clicks. But on all production servers you need to install environment manually. This knowledge you will use later much more times. You will better understand how all is works and how to find reason of bug.(error)

Syncing MAMP MySQL Database on MEGA

SO I've read countless tutorials and I've spent hours trying to solve this but have run out of ideas. Trying to sync my Wordpress database on MEGA (every other tutorial said dropbox but I got MEGA) and everything but one things works on my windows PC.
I've installed MAMP for both (available for Mac and windows now), made them the same settings and properly integrated MEGASync with it. I created the symlink from both Windows and Mac and updates seem to be happening when I make changes or fool around with wp-config to fix this.
With wordpress I ran the installer on the MAC and it works fine for syncing. On Windows 8.1 however everything functions between MEGA but when connecting to http://localhost:8888 or http://127.0.0.1:8888 Im simply getting a 'Waiting for Connection". Opening phpmyadmin from either computer shows the database I created as well.
Things I've tried.
- Turn off firewall
- Ran a netstat -a command and found it was listening on 0.0.0.0:8888
- Tried to visit localhost:8889 (mysql) and it downloaded a file.
- Made sure my hosts file had 127.0.0.1 localhost and has ::1 localhost
- Can ping localhost and 127.0.0.1
- Checked apache logs and found them empty
Anything I can do to try and log where to narrow down why it's timing out (it seems) on my local windows box?
Not sure if it's much of a solution but did solve this. I uninstalled both MAMP servers (Mac and Windows) and did the entire setup process but started on the Windows machine first this time.
I think the problem was a different structure had been synced (not synced) from both computers (Mac was looking like a different file structure).
No I see the proper contents in both directories.

Slow MySQL in VMWare, but Apache works ok

I have OSX running VMWare with W7 Pro. This machine is configured to bridge the network adapter, so it's in the same network of OSX but with a different local IP. I installed Apache and MySQL, and I use virtual hosts; so far, so good. Any virtual hosts that I create that don't use MySQL (just static HTML or PHP sites) load really fast on OSX's browsers, but sites that need to use MySQL take a long time to load. I've investigated a lot (as far as my language understanding allows) and the only solution that worked partially is to use
skip-name-resolve
This accelerated the loading time from 10 seconds to 8 or 7, but it's still annoying for development, and more if other sites load immediately. I appreciate any help you could give me.