MySQL doesn't start in xampp in mac osx - mysql

I'm on Max OS X Yosemite and have installed fresh version of XAMPP.
However, MySQL doesn't seem to start.
I've already looked in the '/Applications/XAMPP/xamppfiles/xampp' file and looks like 'unset DYLD_LIBRARY_PATH' is already there.
followed this thread here and killed the Mysql process but it also doesn't seem to work
When I execute this command
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
It throws an error
"Starting MySQL
... ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/MacBook-Pro.local.pid)."
How should I fix this?

For me help this fix.
Step 1: Go to your Finder and edit the file as the following path below.
/Applications/XAMPP/xamppfiles/etc/my.cnf
Step 2: Open the file and find the [mysqld] section
add one line as following
innodb_force_recovery = 1
,and save.
Step 3: Run command in your Terminal
sudo /Applications/XAMPP/bin/mysql.server start
Wait until everything is OK.
Step 4: Edit the my.cnf again and remove the line you just added
innodb_force_recovery = 1
,and save.
Step 5: Stop for restart
sudo /Applications/XAMPP/bin/mysql.server stop
Wait until everything is OK.

Hello I 'm using Mac OS X as well, once used XAMPP but also gave me errors sometimes , I recommend MAMP has not given me any problems ever and is easy to deploy.

Related

Issues starting MySQL server Mac

There are red dots, rather than green dots, next to "Active Instance" in the preference pane. Image here. When I click "Start MySQL Server" the lights flash green very briefly before turning red again. In other install tutorials (e.g. this), this doesn't happen.
However, when I try to use command line to start the server, with sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist I get the line /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist: service already loaded Load failed: 37: Operation already in progress. So it seems like some parts are already loaded.
When I try to launch MySQL (with mysql -u root -p), I get the error:
dyld: Symbol not found: __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE Referenced from: /usr/local/mysql/bin/mysql (which was built for Mac OS X 12.0) Expected in: /usr/lib/libc++.1.dylib in /usr/local/mysql/bin/mysql Abort trap: 6
I get the same error when I try to do mysql --version.
Previously, I was getting the error -bash: mysql: command not found, but then I followed the suggestion here and added the path export PATH=$PATH:/usr/local/mysql/bin. (Note that I still get the -bash: mysql.server: command not found when I try mysql.server start, so I don't know if the new path export fixed the problem altogether.) I re-installed MySQL from the DMG but still getting this error.
Additional information that may be relevant:
-I am on Mac OS X 11.6.5.
-I have uninstalled/re-installed MySQL several times
-I copied my.cnf and put it in the "Configuration File" spot in preferences, with the file path: /private/etc/my.cnf. This is also a part where it's possible I went wrong, since I don't exactly know what I'm doing; I just tried to follow directions from here, here and used the actual code from here. I also tried putting the my.cnf file in /usr/local/mysql, as some other sources seem to suggest. This did not work either.
Solved: what I needed to do was uninstall MySQL and instead download an archived version of it--8.0.24 instead of the latest, 8.0.32, because it hadn't been compatible with my Mac version.

PM2 keeps getting killed every 90 seconds on centos 8

I just installed CentOS 8 and added nodejs (tried v12 & v14) And then I installed pm2 using npm install pm2#latest (so at the time of posting it uses v4.4.0). I did try an older version (v3.5.0), but it does the exact same thing.
and after pm2 got installed, i ran the command "pm2 startup"
after a restart, pm2 does start, but gets killed after 90 seconds and then restarts giving this message
"pm2 has been killed by signal, dumping process list before exit..."
First, I thought it was because of my app (the one that pm2 is supposed to manage), but i removed it from pm2, so it's practically empty, but it does the same thing
Running the following command as root worked for me:
pm2 update
I had the same issue and I tried several solutions online but none worked for me.
However, I completely removed pm2, restarted the server, and reinstalled pm2 and that does it for me.
1- Stop and remove pm2
pm2 kill
sudo npm remove pm2 -g
2- Restart the server
sudo reboot
3- Log in again, then reinstall pm2
sudo npm install -g pm2
I did not disable SE Linux (I think it's not safe to disable it), but the following method helped me:
Edit file: /etc/systemd/system/pm2-root.service
Add new line: Environment=PM2_PID_FILE_PATH=/run/pm2.pid
And replace: PIDFile=/root/.pm2/pm2.pid to: PIDFile=/run/pm2.pid
Versions:
CentOS 8.3.2011
Node.js 14.16.0
NPM 7.7.5
PM2 4.5.5
Original answer. Thanks Alec!
Later update. For those who are facing the same issues. It's an issue related to SE Linux. Known workarounds (the ones I discovered).
Disabling SE Linux (obviously, not recommended)
go to /etc/systemd/system/pm2-root.service - comment PIDFile=... (add a # in front of that line)
Audit and trace - use following commands:
# dnf install policycoreutils-python-utils setroubleshoot-server -y
# journalctl -f
At ths point, you should see the solution in the output (the log)
it should be something like:
# ausearch -c 'systemd' --raw | audit2allow -M my-systemd
# semodule -i my-systemd.pp
You need to do the last step (ausearch... and semodule...) twice - I did it once, restarted the machine and noticed the same issue after 90 seconds. But if you read the log carefully, you will notice that the issue seems to be outputed twice. (looks the same). Probably two things are trying to write to that file (pm2-root.service).
Still waiting for the perfect solution (done by the person that really knows how to fix this in a proper manner), but for those that have this issue, any of these options seem to work just fine.
I've had this problem (on Debian), when for some reason two "PM2 God Daemon" processes (not threads) were launched, so they conflicting with each other.
Killing one of them solved the issue.

Apache not starting on MAMP Pro

Apache wont start and it throws an error:
OR
Apache couldn't be started. Please check the log file for more information.
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libmecabra.dylib
Expected in: /Applications/MAMP/Library/lib/libiconv.2.dylib
in /usr/lib/libmecabra.dylib
/Applications/MAMP/Library/bin/apachectl: line 80: 2799 Trace/BPT trap: 5 $HTTPD "$
This is the same for multiple ports. The reccomended MAMP ports AND the regular apache ports.
MySQL starts perfectly fine.
Any suggestions?
Locked. Comments on this answer have been disabled, but it is still accepting other interactions. Learn more.
I updated to the latest version of yosemite last night.
You apparently have to go to your MAMP folder in Applications. Go to bin -> apache2 -> bin.
Then rename the file from envvars to _envvars.
I also came across another problem of it not working correctly. Make sure the ports are Apache defaults, NOT MAMP defaults (port 80 etc). If it works straight away, this should not apply to you.
Installing the latest release of MAMP 3 Version 3.0.7.3 in my case seems to solve this issue.

MySQL with MAMP does not work with OSX Yosemite 10.10

[EDIT]
The last version of MAMP with the last version of OSX Yosemite works fine.
I installed the beta of Yosemite two month ago, no problem with MAMP.
With the last release of OSX, Apache and MySQL did not work.
I found a solution for Apache by using the default port 80 and renaming the file envvars to _envvars in Applications/MAMP/Library/bin but have not been able to solve the problem with MySQL.
Per the Knowledge Base at MAMP for "Apache will not start - Yosemite Beta":
Rename the file envvars located in /Applications/MAMP/Library/bin into _envvars
You can also try this workaround posted at http://community.bitnami.com/t/mysqld-doesnt-start-in-mac-os-yosemite/25153
/Applications/XAMPP/xamppfiles/xampp
Look for:
$XAMPP_ROOT/bin/mysql.server start > /dev/null &
And add unset DYLD_LIBRARY_PATH on top of it. It should look like:
unset DYLD_LIBRARY_PATH
$XAMPP_ROOT/bin/mysql.server start > /dev/null &
I hope it helps
On MAMP, I was able to get MySQL to work by editing /Applications/MAMP/bin/startMysql.sh and unsetting DYLD_LIBRARY_PATH. So the updated script looks like this:
# /bin/sh
unset DYLD_LIBRARY_PATH
/Applications/MAMP/Library/bin/mysqld_safe... etc.
It also required killing all MySQL processes previously started by MAMP.
Had same issue today (running last version of Yosemite preview), Apache of XAMPP for OSX didn't work / start. Apache's log files contained no errors.
Finally I've solved this issue by removing XAMPP for OSX and installing latest version of AMPPS (http://www.ampps.com/downloads).
I don't know what's the different or what's the initial problem causing this behaviour - but with AMPPS everything just runs fine.
Hopefully this will work also for you.
This solved my problem with mysqld and apache on XAMPP:
As you can see, Yosemite DP 5 changes a few things in its library. Probably if you’re running XAMPP server on DP5 it won’t start mysqld (MySQL database daemon).
What you should do?.
STEP 1
. Download Homebrew. Open your terminal and then type:
. . . ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
STEP 2:
. Download LIBICONV, you have to type the following lines at terminal:
. . . brew install libiconv
. . . brew link libiconv —force
STEP 3
. Download SQLITE3, you have to type the following lines at terminal:
. . . brew install sqlite3
. . . brew link sqlite3 —force
STEP 4
. Go to Applications/XAMPP/xamppfiles/lib and then delete the following files (remember to empty your trash).
. . . libsqlite3.dylib (it is an ALIAS)
. . . libsqlite3.0.8.6.dylib
. . . libiconv.2.dylib
. . . libiconv (it is an ALIAS).
STEP 5
.Restart you “manager-osx.app” then try to turn on your mysql database.
Via: http://exequielplaza.com/funstuff/xampp-dp5-yosemite-mysqlfix.html
OP question was about MAMP.
I had this issue after installing OSX Yosemite and fixing the envvars to _envvars in the bin/apache2/bin folder.
Then I was getting this socket error. So I checked the error logs for mysql and noticed this:
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
gee I love error logs.
I found the process mysqld in Activity Monitor and killed it. Restarted MAMP and bingo! It all seems to hook up now!
I have resolved the situation by changing the default Port of Apache 2.4 updated after upgrading to MAC OS Yosemite.
The file is located in: /etc/apache2/httpd.conf
Change
Listen 80
to
Listen 8080
Restart your MAC, and try to launch again MAMP Services.
I fixed this by uninstalling XAMMP and reinstalling. If you go with this approach make sure to back up any content you may have saved in the XAMPP folder.
I am also running into the same problem with MAMP.
Absolutely clueless but with the other responses pointing toward a recent update in OSX I can believe that the problem stems from here. Uninstalled and reinstalled MAMP and MySQL is the only operation able to run...Apache still hangs. Will be downloading AMPPS to see if this corrects things.
I still needed to use envars so I was able to work around this by removing the following from the file. Found some errors when launching through terminal related to this
if test "x$DYLD_LIBRARY_PATH" != "x" ; then
DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
else
DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib"
fi
export DYLD_LIBRARY_PATH
I have had the same issue and none of the above worked.
The Apache server in MAMP wouldn't work on port 80, or 8080 (The default Apache ports).
The issue is with Apache being enabled by default in Yosemite.
Either: change the Apache port in MAMP (Not preferable if you want to use the default port), or unload the launch Daemon by typing the following into the terminal:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Edit the below file, with this command on Terminal.app:
sudo vim /Applications/XAMPP/xamppfiles/mysql/scripts/ctl.sh
On line #59, delete this:
/Applications/XAMPP/xamppfiles/xampp startmysql > /dev/null &
and put this
/Applications/XAMPP/xamppfiles/bin/mysql.server start > /dev/null &
(save the file: ESC :wq!)
Restart All Servers on XAMPP.app (manager-osx)
Just to add to this thread, for those running Bitnami MAMP I had the same issue when upgrading to Yosemite (Mampstack-5.4.28-0). I solved it by going to
Applications/Mampstack-(your version)/mysql/scripts/ctl.sh
and adding the following
MYSQL_PIDFILE = ....
unset DYLD_LIBRARY_PATH <==== Add this
MYSQL_START = ....
MYSQL spun like silk. Hope this helps someone with the same problem.
I've found this video. This works for me.
Go to MAMP in Applications
then, bin > apache2 > bin and rename 'envvars' to '_envvars'
https://www.youtube.com/watch?v=brpKAM2WXhk
Above solutions didn't work for me as I had no conflicting mysqld instances running. After check the mysql error logs in MAMP, it was obvious msqld was having all sorts of issues starting. The main error was:
[ERROR] /Applications/MAMP/Library/bin/mysqld: unknown option '--//skip-networking'
Which pointed me to an option in my.conf file. Somewhere along the line with debugging another issue I had added:
//skip-networking
As an option or I had commented it out. Removing that line allowed mysql in MAMP to start correctly.

Mac OS X, MySQL Preference Pane doesn't work

I downloaded and installed MySQL 5.1.47 for OS X 10.6 using the DMG archive:
mysql-5.1.47-osx10.6-x86_64.dmg
I also installed MySQL.prefPane and MySQLStartupItem.pkg. MySQL.prefPane is a Preference Pane. The problem is, whenever I attempt to start/stop MySQL from the Preference Pane, System Preferences just hangs. It runs at about 50% CPU forever, eventually I have for force quit System Preferences. The same thing happens if I toggle "Automatically Start MySQL Server on Startup". Basically the MySQL Preference Pane is not functional.
Note that I have no problem starting MySQL from the command line:
sudo /usr/local/mysql/bin/mysqld_safe
I have tried reinstalling MySQL and the Preference Pane. I'm using the standard installation location, nothing out of the ordinary. Every time the MySQL Preference Pane just hangs.
I'm doing this on a Macbook Pro (Intel) running OS X 10.6.3. There are no old versions of MySQL on this machine.
Follow-up: Well it's now January 2012 so I figure I'd check to see if this has been fixed. I tried the latest MySQL 5.5.20 on OS X 10.6.8 and it's still broken - same behavior, it just hangs (had to force quit). I tried Jamie Wong's and carloandaya's suggestions, both did not work.
Under OS X Lion the following worked for me:
edit /usr/local/mysql/support-files/mysql.server
change lines ~ 46 & 47
basedir=
datadir=
to
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
For anyone still encountering this problem, see: http://bugs.mysql.com/bug.php?id=53232
Specifically, here's Rembert Oldenboom's response:
Issue still exists with mysql 5.5.8 on
brand new on mbp i7 2.8. With the
comments of others the fix was easy:
Edit
/usr/local/mysql/support-files/mysql.server
Search for "Set some defaults" about 4
lines down, replace the line
basedir=.
with
basedir=/usr/local/mysql
Then search for "Set pid file if not
given" about 3 lines down, replace the
line
mysqld_pid_file_path=$datadir/`hostname`.pid
with
mysqld_pid_file_path=$datadir/`/bin/hostname`.pid
Now the prefPane will work.
old stack overflow post! The world has changed a great deal, and I wanted to share my solution to this problem. The issue for me was the time zone tables AND Stephen's answers.
I did:
edit /usr/local/mysql/support-files/mysql.server
change lines ~ 46 & 47
basedir=
datadir=
to
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
AND updated my my.cnf.
I had a default-time-zone set to UTC. I had to comment out that line.
default-time-zone = UTC
to
# default-time-zone = UTC
Start server using plist file (check your plist path/name!):
sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
I then loaded MySQL time zone tables from Mac OS time zone files:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root --password="YOUR_PASSWORD_HERE" mysql
I then stopped MySQL and restarted using my plist file.
sudo launchctl unload -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
After that, I was able to stop/start using the preference panel!
I've installed and re-installed MySQL 5.5.15 using some of the tips that I found on the net. I found that selecting "install for all users of this machine" rather than "install only for current user" after double-clicking the preferences pane installation from the .dmg file makes it work. It's the only step that I changed in my many installations of MySQL on Snow Leopard.
Are you sure that panther supports 64 bits apps ?
Seems that when a I'm trying to open a 32 bits preference pane on snow leopard, the preference pane says "well this pane is 32bits, and you've got a 64bits macos, I'm restarting this pane"
Maybe it's hanging because it's the opposite ? getting 32bits preference pane and trying to open a 64bits pane ?
I had this problem too. It turned out that I installed the 32 bit MySQL server on my 64 bit Mac on accident. Woops! I would recommend verifying your processor type (32 or 64 bit) and reinstalling the according MySQL DMG.
It took me a couple of days to figure this out! MySQL was still running fine in the background, it's just the preference pane and connecting to it via terminal that would not work.
I hope this works for you!
This worked for me :
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Problem I recognised was of permission to mysql.server
Other solutions here didn't work for me, but I cobbled together my own solution with the help of this bug ticket: https://bugs.mysql.com/bug.php?id=28854 (specifically the comment by BuB Javier)
The trick was twofold:
Create a /bin/pidof file using the code from http://www.cs.cmu.edu/~benhdj/Mac/unix.html
#!/bin/sh
ps axc|awk "{if (\$5==\"$1\") print \$1}"|tr '\n' ' '
Make sure it's executable.
Create a /etc/my.conf or ~/.my.conf file with the pid-file option specifying the path to the PID file (e.g. /usr/local/mysql/data/`hostname`.pid). (This is easy to do within MySQLWorkbench.)
I discovered this after trying to stop the server in MySQLWorkbench and it throwing "PID file not found!" error messages. Apparently specifying the pid-file location in the mysql.server file doesn't work.
I did change some permissions to _mysql:wheel here and there as frequently suggested, but I'm not sure that mattered in my case. After doing the two steps above, the preference pane was working again. If it doesn't work for you, try changing some file permissions.
MySQL 5.6.25 Community Server (64bit)
Mac OS X Mavericks (10.9.5)