MAMP doesnt work with Yosemite after the Patch - mysql

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.

Related

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

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?

MariaDB cannot start after update: [Warning] Can't create test file /home/mysql/beta.lower-test

I've just updated MariaDB using apt-get dist-upgrade. Now it won't start using service mysql start anymore.
I can however, run it as root or do: sudo -u mysql mysqld_safe then MariaDB starts up fine. The folder /home/mysql is owned by the mysql user and group.
I've found the error to be thrown in this function:
https://github.com/MariaDB/server/blob/7ff44b1a832b005264994cbdfc52f93f69b92cdc/sql/mysqld.cc#L9865
I can't figure out what to do next. Any pointers?
To run MariaDB SQL from /home, in the file /usr/lib/systemd/system/mariadb.service or /lib/systemd/system/mariadb.service, just change :
ProtectHome=true
to :
ProtectHome=false
The answer by Thomas is correct, but get's reset by updates every few months. So here is a permanent solution:
Use systemctl edit mariadb to create a file overwritting the default settings of the mariadb service. (In debian it's located in /etc/systemd/system/mariadb.service.d/override.conf)
Set the same setting Thomas changed in the file:
[Service]
ProtectHome=false
Use systemctl daemon-reload to reload the systemctl config.
On debian 9 you need to change ProtectHome to false in both /lib/systemd/system/mariadb.service and /lib/systemd/system/mariadb#.service then run sudo systemctl daemon-reload.
Maybe also run sudo grep -Ri "protecthome" /lib/systemd/system to find other instances of ProtectHome in mysql-related files if this still isn't working
The workaround for this is mounting the directory in home as /var/lib/mysql:
mount --bind /home/mysql/var/lib/mysql /var/lib/mysql
Same situation after update on Debian 8 (Jessie) and 9 (Stretch). After "apt-get upgrade" the command
service mysql start
the server fails to start and logs error:
[Warning] Can't create test file /home/johndoe/UserDatabases/mypcname.lower-test
the solution is to change in file /lib/systemd/system/mariadb.service the value:
ProtectHome=true
to
ProtectHome=false
as described above.
#RedGiant yes I solved it. Forgot to post here.
Apparently after the .1 release you cannot run SQL from /home anymore. There's probably a way around this but haven't found it.
I can run MySQL from any location except /home. What I did was unmount /home (I had my SSD RAID mounted to /home) and re-mount my disk as /ssd. Changed my paths in the config and it worked right away.
I did not run SELinux or Apparmor.
I have faced the same issue as mentioned in the question. In my case, I wanted to move the MariaDB Data Directory to the /home/mysql folder but after changing the my.cnf file, MariaDB service was failing to start.
I have made the following changes in the file /lib/systemd/system/mariadb.service
ProtectHome=true to ProtectHome=false
It asked me to reload the daemon while starting the Mariadb service again. However, i have rebooted the server and started the MariaDB service without any issue.

ERROR! The server quit without updating PID file XAMPP

I know there are a lot of similar problems, but I have to post this because I am not finding a solution yet. Below is what happens when I try to run mysql. Not using homebrew here! I originally fixed the problem by killing the process ID for mysqld, but since I shut my computer down and relocated, then restarted, I am getting this error again. It seems to be the same except the difference with this error is the local.pid part. This was not in my original error message and wandering how to fix this?
Original error fixed by killing the process ID:
ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/genevieve-ouellons-macbook-pro.pid)
The new error after shutdown, relocate and trying to start:
genevieve-ouellons-macbook-pro:bin genevieveouellon$ cd /Applications/XAMPP/xamppfiles/bin
genevieve-ouellons-macbook-pro:bin genevieveouellon$ ./mysql.server start
Warning: World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored
Starting MySQL
. ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/genevieve-ouellons-macbook-pro.local.pid).
Anyone have this problem?
Thanks
It worked by using these two commands:
cd /Applications/XAMPP/xamppfiles/bin
sudo ./mysql.server start
Using sudo is the keyword that made the difference this time around.
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Above command worked in my case, only if the port is empty..
If this results error, restart server/mac and try the above command.. Hope this helps for someone..
Might've been deleted when you manually restarted mysql or renamed your machine. Not sure about XAMPP but when using mysql on OSX this is my go-to..
cd into /Applications/XAMPP/xamppfiles/var/mysql/
rm -rf *.local.err (deletes file)
touch YOURUSERNAME.local.pid (generates *.local.pid file the error thrown was complaining about)
cd back into your project and restart mysql using mysql.server start
Finally solved this issue... (3 days later)
Open up YOURUSERNAME.local.err in /Applications/XAMPP/xamppfiles/var/mysql/ with a text editor.
I had "InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files"
Then follow instructions on http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html as it states in the log file
Add innodb_force_recovery = 2 after line: [mysqld] to your my.cnf located in /XAMPP/xamppfiles/etc/
Then sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Give it a minute and it should repair itself
Comment out with #innodb_foce_recovery = 2 in my.cnf
Unfortunately none of possible solutions did not helped me.
Still the Mysql was not able to start and in terminal I saw only /Applications/XAMPP/xamppfiles/var/mysql/: "ERROR!" without any further info
I simply reinstalled XAMPP again - worked

ERROR! MySQL manager or server PID file could not be found! QNAP

I am having an issue where MySQL isn't starting on my QNAP NAS.
I found this first by not being able to log in through phpMyAdmin - was getting error:
#2002 Cannot log in to the MySQL server
I then went to attempt to start mysql, as I guess this is a common issue with this, but it just gave a generic error.
I went through troubleshooting the mysql.sock file and everything, changing its permissions, but nothing is working.
I have rebooted my NAS many times.
I eventually tried to restart mysql. In doing so I get:
ERROR! MySQL manager or server PID file could not be found!
I can't find anything specific to the QNAP or any general type troubleshooting for this. Everything I find seems to be OSX related.
After a lot of searching, I was able to fix the "PID file cannot be found" issue on my machine. I'm on OS X 10.9.3 and installed mysql via Homebrew.
First, I found my PID file here:
/usr/local/var/mysql/{username}.pid
Next, I located my my.cnf file here:
/usr/local/Cellar/mysql/5.6.19/my.cnf
Finally, I added this line to the bottom of my.cnf:
pid-file = /usr/local/var/mysql/{username}.pid
Hopefully this works for someone else, and saves you a headache! Don't forget to replace {username} with your machine's name (jeffs-air-2 in my case).
I tried everything above, but saw no results until I got a hint from here: https://superuser.com/questions/159486/how-to-kill-process-in-mac-os-x-and-not-have-it-restart-on-its-own
I eventually went over to the activity monitor in my Mac, force Quit the PID, and ran the command:
sudo /usr/local/mysql/support-files/mysql.server restart
The magic was done!!!
If you have installed MySQL using brew the best way to go would be with homebrew
brew services restart mysql
after you run that command, all the problems that the update generated will be resolved
I ended up figuring this out on my own.
In searching for my logs I went into
cd /usr/local/mysql/var
In there I found the file named [MyNAS].pid (replace [MyNAS] with the name of your NAS.
I then ran the following to remove the file
rm -rf /usr/local/mysql/var/[MyNAS].pid
I then restarted mysql
[/usr/local/mysql/var] # /etc/init.d/mysqld.sh restart
/mnt/ext/opt/mysql
/mnt/ext/opt/mysql
Try to shutting down MySQL
ERROR! MySQL manager or server PID file could not be found!
/mnt/ext/opt/mysql
Starting MySQL. SUCCESS!
I tested everything and it all works like a charm again!
Run the below commands and it will work.
Go to terminal and type
sudo chown -RL root:mysql /usr/local/mysql
sudo chown -RL mysql:mysql /usr/local/mysql/data
sudo /usr/local/mysql/support-files/mysql.server start
Just run mysqld (don't run as root) from your terminal. Your mysql server will restart and reset everything like shown in the picture below:
And use a command like so:
mysql -u root -h 127.0.0.1
ERROR! MySQL server PID file could not be found!
This might be due to issues with disk space, disk inode usage or innodb corruption which may lead to the error.
The issue was with the pid file and the solution was:
SSH login to server as a root
Create directory /var/run/mysql
mkdir /var/run/mysql
3) Create a file with name as mysqld.pid
touch mysqld.pid
Change its ownership and group to mysql:mysql
chown mysql:mysql mysqld.pid
Restart MySQL service
Done!
I had the same issue. It turns out I added incorrect variables to the my.cnf file. Once I removed them and restarted mysql started with no issue.
Check if your server is full first, thats a common reason (can't create the PID file because you have no space). Run this to check your disk usage..
df -h
If you get something like this, you are full..
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 40G 6.3M 100% /
In that case, you need to start looking for what to delete to make room, or add an additional drive to your server.
Nothing of this worked for me. I tried everything and nothing worked.
I just did :
brew unlink mysql && brew install mariadb
My concern was if I would lost all the data, but luckily everything was there.
Hope it works for somebody else
Note: If you just want to stop MySQL server, this might be helpful.
In my case, it kept on restarting as soon as I killed the process using PID. Also brew stop command didn't work as I installed without using homebrew. Then I went to mac system preferences and we have MySQL installed there. Just open it and stop the MySQL server and you're done. Here in the screenshot, you can find MySQL in bottom of system preferences.
I know this is an older post, but I ran into the ERROR! MySQL server PID file could not be found! when trying to start MySQL after making an update to my.cnf file. I did the following to resolve the issue:
Deleted my experimental update to my.cnf
Deleted the .net.pid and .net.err files.
delete /usr/local/var/mysql/**<YourUserName>**-MBP.airstreamcomm.net.*
Ensured all MySQL processes are stopped.
ps -ax | grep mysql
kill **<process id>**
Started MySQL server as normal.
mysql.server start
First find PID of mysql service
ps aux | grep mysql
Then, you have to kill process
sudo kill <pid>
After you again start mysql service
mysql.server start
After doing setup of PHPMyAdmin, I was also facing the same problem,
Then I just stopped the MYSQL server by going into System settings, and then started again, and it worked.
root#host [~]# service mysql restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/host.pxx.com.pid).
root#host [~]# vim /etc/my.cnf
Add Line in my.cnf its working know
innodb_file_per_table=1
innodb_force_recovery = 1
Result
root#host [~]# service mysql restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL……….. [ OK ]
root#host [~]# service mysql restart
Shutting down MySQL…. [ OK ]
Starting MySQL. [ OK ]
Source
I have the same problem. I found the file {username}.local.err instead of {username}.local.pid inside /usr/local/mysql, then i changed the name *.err to *.pid and it works fine.
Starting MySQL.
SUCCESS!
My OS El Capitan 10.11.5
If you're using MySQL Workbench, the mysql.server stop/restart/start will not work.
You will need to login into the workbench and then click "shutdown server". See image attached.
I was able to solve this on OS X by shutting down the existing mysql.server that was running:
mysql.server stop
The starting:
mysql.server start
From there I could run mysql.server restart without throwing the ERROR.

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