Local wordpress issues: Mac MAMP - mysql

I'm having some issues with my local environment. I had setup a wordpress site locally on my Mac through MAMP. All was working well until my computer powered down (not plugged into power source). Now there appears to be issues with the database. When i run MAMP and try to connect I get the error "Error establishing Database Connection". Also when i go through the MAMP portal at localhost and click on Tools > PHPMyAdmin I get the following error:
MySQL said: Documentation
#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).
mysqli_real_connect(): (HY000/2002): No such file or directory
Obviously something has gone very wrong with the database connection but do not know how to resolve. I have tried to run some scripts in terminal to stop mysql process to no avail so far.
Any advise appreciated. I have looked at some similar but not exact other posts and does not seem to resolve.
Note: The ports changed at some point in the process, but everything else seems fine related to the new port setup but this may be relevant
thanks

While, I'm not sure of the cause. FINALLY found a solution to this very frustrating issue.
What ended up working for me is to uninstall the new version 4.2.1
I did this through first going to the MAMP PRO folder and using the MAMP Pro uninstaller and then moving the Mamp and Mamp pro folder to the trash.
I then went and found the old version to install
https://www.mamp.info/en/downloads/older-versions/
When I downloaded 3.5.2 whatever issues it was having with local databases were resolved. Go figure! Glad to finally have resolved not sure why this would happen other than perhaps a bug in the new version.
Thanks to those who pointed out some possible things to look at

I'm running MAMP 4.0.6 and getting the same error on local wordpress installations, and same error message as described when trying to go to phpmyadmin on MAMP.
The reason seemed to be that the mysql server does not start. The solution that worked for me is offered in this reply in another thread:
https://stackoverflow.com/a/45582509/4623519
Quit MAMP. In the finder go to Applications/MAMP/db/mysql/. Delete the last log file (look for a file named ib_logfileN – being N the log number Eg-ib_logfile0 and ib_logfile1) Nice screenshot provided in link above.
This seems to be happening often according to this post from 2013.

Related

Installed Mysql, Wordpress, and WAMP server. Create database failed to exist even though phpMyAdmin showed it created

I installed MySql community server on Windows 10 Home. Then, I installed WAMP server 64 to setup an Apache php server. Finally, I installed Wordpress where my problem arose. All products are current releases just downloaded.
During installation of Wordpress, phpMyAdmin says the database was created and it shows on the left panel. The name is wordpress_db. MySQL Query Workbench doesn't find it with a SQL show databases command. Wordpress gave an error "not found". I finally manually created the db in MySQL Workbench, rebooted, and after restarting Wordpress on the Apache server created I was able to finish the installation. There were no errors showing with the db create from phpMyAdmin and it allowed me to set privileges for users without a problem. I can't explain what happened and don't particularly like mysteries that just go away. They always com back to haunt you!
Can anyone shed any light on what happened during the installation and db_create?
Thanks in advance for anyone who looks at this.
Update
I uninstalled and reinstalled and the problems went away. Now I am running a MySQL instance that isn't distributed directly from the vendor and I lost some of the things that come with MySQLcommunity server.
One thing to note - the installation docs don't tell you to change the port on MariaDB from 3306 to something else using phpMyAdmin when you are using MySql. Once i changed the port, the server instances instantly popped up green. They were initially orange.
thanks

XAMPP, MAMP, MySQL errors

I'm facing a lot of errors at the moment ranging from "No such file or directory" to "Error 403 - Access to the requested directory is only available from the local network." along with a series of permission obstacles relating to mysql.
Admittedly I was playing around with mysql, XAMPP and MAMP today (I'm new to back-end programming) and think I've screwed something up somewhere that's preventing them from working correctly.
Specifically, I'm using XAMPP now and while the status is fine (green) and connected to my IP address, along with MySQL, Apache and ProFTPD services all being connected, I can't find any of the related XAMPP files needed to resolve Error 403. Eg.
Bryans-MacBook-Pro:~ bryanjordan$ chmod -R 777 /Applications/XAMPP/xamppfiles/var
chmod: /Applications/XAMPP/xamppfiles/var: No such file or directory
When I open XAMPP, right-click and all in the Applications directory, all I see is a Contents folder with no reference to xamppfiles.
To clarify, I downloaded XAMPP, imported into Applications, opened, connected to servers and once re-directed in my browser, clicked phpMyAdmin but reached the 403 Error.
I've also linked MAMP and don't have this issue. I can access phpMyAdmin fine through this process.
I should also note, that even though I have MAMP operating fine, I can't access mysql via the command line even when I use the path directory instead of a simple, mysql -u root -p call. Instead I get this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
I'm unsure if this is related but before downloading MAMP or XAMPP I was able to type "localhost/~bryanjordan" into the browser and I'd be redirected to my Sites directory. When I type the same URL in now, I receive this error:
The requested URL /~bryanjordan/ was not found on this server.
Thanks for the help!
Setting up xampp or mamp should be simple to setup. Here is a link to a handy tutorial: https://www.webucator.com/how-to/how-install-start-test-xampp-on-mac-osx.cfm
For XAMPP if it cannot find the folder make sure its actually in your applications folder and make sure your system has permissions to read and write to it.
For MAMP or even XAMPP, if you cannot start your mysql it might be permissions. Please see the link above for the relevant command to run on the command line.
Also given the amount of errors you are having i would recommend removing both and starting from scratch with just one of them using my link above.
Hope this helps!

Wamp Server is always orange due to an error in MySQL service

My Wamp Server was working perfectly well until yesterday when I started the mysqld from the command line and went on to import a .sql file from the MySQL console. The WAMP icon stays orange all the time. There is no issue with the Apache service but the issue is with the MySQL service. When I looked for wampmysqld service on services.msc, it doesn't show any. But when I run mysqld from the command line, it works fine.
Itried several methods but none of them worked. I also tried installing Wamp Server 2 as an addon but it didn't work for me, and now I can't select the version of MySQL even.
Can anyone please help me out?
It sounds like you have 2 MYSQL Servers running.
Check the Event Viewer for messages from MYSQL.
Check the services, wampservers MYSQL is called wampmysqld64, if you have another running it will probably be called MYSQL
If this is the case, you will either have to uninstall the other MYSQL or at least Stop it in the services snapin, or disable it, if you are sure it was a mistake uninstall whatever brought this other MYSQL to your party
What did you install recently, some apps bring their own mysql instance for example some installs of MySQL Workbench will install an instance if you pick the full with everything version.

homebrew: MySQL not starting, Can't update PID file

I am a new Mac user and trying to set up the development environment with Apache, PHP and MySQL. Initially, after a lot of installs and reinstalls i succeeded in installing MySQL (Apache and PHP came bundled with Mac) but now again mysql refuses to start up and gives the error, The server quit without updating PID file (/usr/local/var/mysql/Nikhils-MacBook-Pro.local.pid).
I have literally gone through entire SO questions regarding this problem but have not found a way to fix this and i mean i have done everything to start this but in vain. I have created the PID file too but it disappears in moments, i did a cleanup and reinstall using this SO Question but it has failed YET again. Please, i need to get my server started, i am really losing on to serious work and time.
Is there any other miraculous way to fix this unattainable feat? Also, if anyone asks what is the error in the log files, please don't as there is no log being registered as the server hasn't started yet.
I’ve got a similar problem with MySQL on a Mac (Mac Os X Could not startup MySQL Server. Reason: 255 and “ERROR! The server quit without updating PID file”) and after a long trial and error process, finally in order to restore the file permissions, I’ve just do that:
launch the Disk Utilities.app
choose my drive on the left panel
click on the “Repair disk permissions” button
This did the trick for me. Hoping this can help someone else.
brew install mysql on mac os
These instructions helped me. There was a my.cnf in /usr/local/opt/mysql/ which seems to have been the problem for me. YMMV.

MAMP Pro Error: The MySQL configuration file my.cnf couldn't be written

I tried to use MAMP Pro to replace previous XAMPP on my Mac due to its easy Virtual Hosts management. However after I installed it. The MAMP, basic version works, but the Pro version keeps given me this error message:
The MySQL configuration file my.cnf couldn't be written.
I googled for a while and there are some different solutions, like create my.cnf on /etc/, but none of these works. Also the error log is empty.
Has someone encountered this before? Or does anyone have a clue how could I solve this problem? Thank you!
I just purchased MAMP PRO and I'm having this error as well. Here's what "fixed" it:
Open Terminal and type in sudo killall -9 mysqld. You might see "No matching processes belonging to you were found," which is fine, it means that MySQL was not running.
Now, in Applications, look for the regular MAMP folder. Open MAMP here and click Start Servers
Now open MAMP PRO and the servers should be started
This is just a work-around, it definitely should not require these. At the very least, this should get you up and running.
Contacting support!
File -> Reset to Factory Settings
Possibly a permissions issue, but I wasn't able to resolve it. The above fixed it for me.
uninstall mamp.
remove all files about mamp.
reinstall mamp.
I removed 'my.cnf' from '/etc' directory. Restarted MAMP pro. Started server successfully.....
Your configuration may be wrong.
exp.
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION # success
or
sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' # error