MySQL and Apache won't start in non-vm XAMPP on Mac - mysql

Previously I was trying to set up a local wordpress website with XAMPP virtual machine, and servers all ran without problem, but I kept getting 403s and 404s in the browser. I switched to the non vm XAMPP, but MySQL and Apache both don't start. I looked up solutions and tried
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
And got the error
..XAMPP/xamppfiles/bin/mysql.server: line 264: kill: (37369) - No such process ERROR!
And for Apache I tried
sudo apachectl stop
and start but neither worked. Any idea what could be wrong, or why the vm version of XAMPP can start the servers but the other doesn't?

Related

MySQL brew cannot run on macOS Monterey?

MySQL suddenly stopped working after updating from macOS Big Sur to Monterey (naive). Local Laravel dev environment suddenly lost connection to MySQL. Couldn't debug it properly (still learning), so decided to do a fresh MySQL installation via brew. Was installed through brew previously as well.
On the final step, mysql_secure_installation shows this:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
brew services start mysql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/stranger/Library/LaunchAgents/homebrew.mxcl.mysql.plist` exited with 5.
Am I doing something wrong? Why would it suddenly drop?
Thanks!
Not a solution, but, according to the MySQL documentation, Monterey is not yet a supported platform.
MySQL Supported Platforms
I tried brew uninstall mysql, brew install mysql and then brew services restart mysql and it did the trick for me

MAMP doesnt work with Yosemite after the Patch

Tried the below
Workaround for the 10.10 Preview 5 bug: Rename the file “envvars”
located in /Applications/MAMP/Library/bin into “_envvars”
Patched by renaming
Quit MAMP and restarted still am getting the following error
When i got to http://localhost/ I get a page that says
It works!
But when i go to the folders that used to work before i get an error
Not Found
The requested URL /prayag/ was not found on this server.
When i try to visit MySQL also i get the following error
Not Found
The requested URL /phpmyadmin/ was not found on this server.
Have you tried to kill all sql service and restart:
Steps:
Quit MAMP
Open the terminal and type: killall -9 mysqld
Restart MAMP
Unless you have removed or otherwise disabled the native Apache server on OSX, it will start automatically and your Servers associated with your MAMP installation won't start.
To see if this is the problem, try opening a Terminal and issue the command:
sudo apachectl stop
Then try starting your MAMP servers again.

Restarted my pc and suddenly MySQL deactivated in xampp(lampp) on Linux 12.04

It was all working fine for a long time i don't even remember when i installed this Ubuntu on my pc it was more than 6 months for sure.
And i have xampp (it's called lampp) on Linux setup and all was working fine, until suddenly now from last restart i can't run MySQL
When i try to go to localhost/phpmyadmin im getting error
#2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured).
When i check localhost/xampp under status it says
MySQL database DEACTIVATED
when i try to restart it i get this
sudo /opt/lampp/lampp restart
Restarting XAMPP for Linux 1.8.3-2...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...ok.
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
But still MySQL not working when i do restart again i get same response. When i try to start/stop just mysql i get this
sudo /opt/lampp/lampp startmysql
XAMPP: Starting MySQL...ok.
sudo /opt/lampp/lampp startmysql
XAMPP: Starting MySQL...ok.
sudo /opt/lampp/lampp startmysql
XAMPP: Starting MySQL...ok.
sudo /opt/lampp/lampp stopmysql
XAMPP: Stopping MySQL...not running.
No matter how many times i try to start it it wont start.
/etc/init.d/mysql or service mysql is not installad and it shouldn't be when using xampp
I tried this MySQL deactivated in Lampp, Xampp on Linux 12.04 and this Couldn't start MySQL! while starting XAMPP. and other answers but no luck
I checked all the logs i could find in /opt/lampp folder but no luck. I checked php.ini httpd mysql config and i don't see anything wrong, all the users permissions and passwords are right.
So any help, what could be the problem so it just stops working when i didn't touched anything just restarted my pc.
I encountered the same thing after I dumbly executed restart command to my entire xampp applications, causing my database to shutdown unexpectedly and crashed the mysql application.
I found this link and followed his solution.
In summary what I did was, in my.cnf, search for this:
[mysqld]
w/c for my case is located at /opt/lampp/etc/my.cnf
and directly below that, on a new line, put this:
innodb_force_recovery = 1
Then I properly restarted my lampp applications using
/opt/lampp/lampp/ stop
and then
/opt/lampp/lampp/ start
Then I check using the
/opt/lampp/lampp/ status
and saw my MySQL is now running
then I revert back the innodb_force_recovery value from 1 to 0.
Alright after loosing all night on trying to fix and looking at logs i finally found an .err file inside mysql databases folder.
The .err file lead to some sort of errors while reading some of the database files, apparently they got corrupted somehow and mysql was not able to read them thus stoping execution and crashed. So i deleted that few files of databases and mysql is running again.

xampp could not be started in ubuntu 12.04?

I installed XAMPP for Linux a couple of days ago and was working fine. Today I do wrongly
chmod 777 /opt/lampp
then MySQL won't be started. then I completely uninstall XAMPP then again install XAMPP then following message come ::
Starting XAMPP for Linux 1.8.1...
XAMPP: Another web server daemon is already running.
XAMPP: Another MySQL daemon is already running.
XAMPP: Another FTP daemon is already running.
XAMPP for Linux started.
then I tried to stop MySQL by typing::
sudo service mysql stop
Then It shows that ::
mysql: unrecognized service
then I tried to stop apache server by typing::
sudo service apach2 stop
Then It shows that ::
apache2: unrecognized service
Any suggestion ??
Try:
sudo /etc/init.d mysql restart

MySQL Mac OS X Problems

something strange is happening while trying to run MySQL server on my MacBook Air.
First ill installed MySQL using brew install mysql. Installation was successful without any errors.
And then problems started to showing up...
First i had to use following command in order to create empty tables:
cd /usr/local
sudo mysql_install_db --user=mysql --ldata=/var/db/mysql
Now im trying to launch the server service itself, but another error is not allowing me to do it:
ivankutsarov$ sudo mysql.server start
Password:
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Ivans-MacBook-Air.local.pid).
While ill navigate to the mentioned folder i cant see mysql folder in it, neither i can see it in my /usr/local/bin directory.
Any ideas guys?
Guys i found the problem. I forgot to run these 2 commands after installing mysql:
First, run: brew help mysql
Read the info displayed after command was executed, and you will notice in the first 2 lines the following commands which are necessary to run in order to start your server!
1.
unset TMPDIR
2.
mysql_install_db --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
I had a similar problem a day ago. mysql functioned fine until out of the blue PID file errors occur. I tried everything to fix the installation, replacing a dozen of files and trying many different settings.
what eventually worked was a clean install of mysql via the dmg package and a migration of my data&schema's to this install (use mysql workbench for this to save time), then uninstalled the version installed via brew.
https://dev.mysql.com/downloads/file/?id=466265