可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
My MAMP mysql server won't start. All of the suggestions I've seen on the web say to check for other mysqld processes running and kill them if they exist, and that it should fix the problem, but it has not for me.
Here's the error log:
130415 13:42:12 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
130415 13:42:12 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
130415 13:42:12 [Note] Plugin 'FEDERATED' is disabled.
130415 13:42:12 InnoDB: The InnoDB memory heap is disabled
130415 13:42:12 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130415 13:42:12 InnoDB: Compressed tables use zlib 1.2.3
130415 13:42:12 InnoDB: Initializing buffer pool, size = 128.0M
130415 13:42:12 InnoDB: Completed initialization of buffer pool
130415 13:42:12 InnoDB: highest supported file format is Barracuda.
130415 13:42:13 InnoDB: Waiting for the background threads to start
130415 13:42:14 InnoDB: 1.1.8 started; log sequence number 1707549
130415 13:42:14 [Note] Event Scheduler: Loaded 0 events
130415 13:42:14 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.5.25' socket: '/Applications/MAMP/tmp/mysql/mysql.sock' port: 0 Source distribution
It looks like the connection is open to me, but MAMP stil errors out with this message: "MySQL wasn't able to start. Please check log for more information."
Any suggestions?
回答1:
What worked for me was removing all files (but not directories) in the mysql dir.
Edit #2 As per answers below, you only need to delete the log files: [ib_logfile0, ib_logfile1]
So quit MAMP and then in the terminal:
rm /Applications/MAMP/db/mysql/ib_logfile* #(or wherever your MAMP is installed)
Edit!: A few people have mentioned that you may want to back up these files first in case anything goes wrong, so maybe just use mv instead:
mv /Applications/MAMP/db/mysql/* /tmp/.
If this doesn't work go back and kill all processes:
sudo killall -9 mysqld
This is also duplicated here:
mysql server won't start MAMP
回答2:
The easiest solution: quit MAMP and remove the log files from MAMP/db/mysql directory [ib_logfile0, ib_logfile1] and restart MAMP.
For more visit http://juanfra.me/2013/01/mysql-not-starting-mamp-fix/
回答3:
rm /Applications/MAMP/db/mysql56/*
Works fine, but then it shows "No database found" in phpmyadmin although there are databases, so my drupal gave me errors because of this.
All I need to do is simply remove two files ib_logfile0
and ib_logfile1
from /Applications/MAMP/db/mysql56/
and that did the trick for me.
回答4:
I looked at the MAMP site. Go into MAMP/db/mysql56 and rename both the log files (I just changed the number at the end). Voila, restarted MAMP and all was well.
Log File names:
- ib_logfile0
- ib_logfile1
回答5:
- Stop MAMP server.
- Then go in following folder:
Applications/MAMP/db/mysql56/
In this folder, please remove all direct files except folders.
This means that you have to remove only auto.cnf, ibdata, ib_logfile,
not any folders.
- Restart MAMP server.
It should work.
Thank you.
回答6:
Most of the answers here are offering to delete random files.
Most of the time, this is the worst thing to do especially if it is important for you to keep the integrity of your development environment.
As explained in the log file, if this problem is not related to a read access permission nor to a file you deleted in your mysql then the only solution is to:
Open your my.conf file from the File menu in MAMP (File > Edit Template > MySQL)
Find and edit this line to be: innodb_force_recovery = 1
Save with ctrl+S
MAMP will offer you to restart your servers
Go back building the next unicorn :)
回答7:
Just type below command in terminal:
rm /Applications/MAMP/db/mysql56/ib_logfile*
and then restart the MAMP.
It works back perfectly.
回答8:
I had to do a combination of things. First I had to change the permissions on my mysql directory. applications/MAMP/db/mysql56/mysql see Stackoverflow here
If that doesn't work add in a my.cnf file to applications/MAMP/conf folder with the following
[mysqld]
innodb_force_recovery = 1
see Adel 'Sean' Helal . answer
This is what ended up working for me.
回答9:
I’ve seen on different answers that we have to remove ib_logfile0
and ib_logfile1
in Applications/MAMP/db/mysql56/
If you use MAMP PRO 4, these files are in /Library/Application Support/appsolute/MAMP PRO/db/mysql56/
Removing theses fils works for me (the serveur doesn’t start after a system crash).
回答10:
Im posting this as a potensial Answer!
What i did to solve this was the following:
- Restart the computer ( to make sure no mysqld processes are running, even if it crashed and tries to restart itself)
- Delete everything that has anything to do with mysql on the computer by running these commands:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySQL*
vim /etc/hostconfig and removed the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/MySQL*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*
- Delete MAMP by running the MAMP PRO uninstaller, then deleting the applications/MAMP folder
- Delete the
Library/Application Support/appsolute
folder (MAMP application support folder)
- Reinstall MAMP PRO
Hopefully this helps :)
回答11:
Ok, so I tried EVERY suggestion i found here on SO and other forums I nothing worked for me. The only solution, that worked for me was to install MAMP 3 version, since I use MAMP for wordpress projects version 3 works just fine.
回答12:
I've tried all the solutions above with version 4.2 of MAMP and none of them worked to me in El Capitan OS, so the only thing that worked was uninstalled MAMP with Clean My Mac and then install the older 3.5.2 version, that one worked right away.
回答13:
MAMP & MAMP PRO 4.0.6 was starting MySql server correctly but stopped doing so after my machine updated the OS to macOS Sierra (10.12.2). I tried a few options mentioned here including setting folder permissions and re-install etc. Nothing seemed fixed the issue for me so I shifted to XAMPP and it is serving OK so far.
Update: I've got MAMP working with this simple solution here.
回答14:
Here's what worked for me:
- Check to see if you accidentally installed mysql via Brew or something.
brew list mysql
- Uninstall it
brew uninstall mysql
- Try to fire up MAMP. Might need to reinstall.
- Eventually upgrade to Vagrant and stop fighting with MAMP.
回答15:
What worked for me was:
I had a process called "mysqld" running even when MAMP had been quit. I force quit the process, restarted MAMP and it worked again.
回答16:
Remove the files ib_logfileN (N being the number) from the MAMP/db/mysql56 folder.
Then restart MAMP.
Should Work!
回答17:
I just had this problem. These are the steps that worked for me.
Open Preferences
in MAMP, make a note of your current Apache and MySQL Port numbers.
Click both Set to default Apache and MySQL ports
and Reset MAMP
buttons then OK.
Quit MAMP
Delete all files (not folders) from /Applications/MAMP/db/mysql
directory.
Reboot MAMP and click Start Servers
.
Note: if MySQL starts fine but Apache doesn't, go back to Preferences
and set Apache Port back to what it was before. MAMP should refresh after you click OK and both Apache and MySQL should start.
If http://localhost/MAMP/index.php
fails to load, open Developer Tools (Chrome), right-click on refresh button and select Empty Cache and Hard Reload
. The phpAdmin page should load. If not try going to Application
panel in Developer tools, select Clear Storage
from the menu and click Clear Site Data
.
I hope those steps provide a quick fix for someone without needed to destroy your database tables.
回答18:
In case of MAMP PRO you need to remove ib_logfiles here:
rm -rf /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile*
回答19:
For me the line innodb_additional_mem_pool_size in my.cnf was causing it
回答20:
Since none of the answers here solved my particular issue, I should probably add my own solution to to the list.
I had to reset my computer while MAMP was still running. This lead to a problem where MAMP was able to start the Apache Server
, but was unable to start the MySQL server
for some reason.
The solution for this issue was:
- Close MAMP
- Go to
Applications\MAMP\tmp\mysql
- delete the file
mysql.sock.lock
回答21:
Best way to find the real cause is to check the MAMP error log in MAMP > logs > mysql_error_log.err
I found the ERROR "Do you already have another mysql server running on port: 3306 ?" - which was actually the cause for my MAMP MYSQL not starting.
Port 3306 was already "busy", so I have changed it to 8306 and that solved my issue.
回答22:
You can try this in your terminal : rm /Applications/MAMP/db/mysql/*
.
It works for me.
回答23:
You need to leave the mysql database AS IS.
- Uninstall and reinstall MAMP Pro.
- For every WP instance that you want to have on your server (localhost), you need to create a NEW database that is not mysql.
- Go into SequelPro and add database.
- Use Duplicator to transfer your WP.
Do not use mysql for anything, it appears to be required by MAMP.