XAMPP, MAMP, MySQL errors - mysql

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!

Related

Cannot find mysql bin file in macos

I am having a lot of problems with mysql on macos 10.14. It started with trying to reset my password. Back when I collaborated with someone in 2018 my collaborator used mysql but I did not know how to work it. I have a feeling that the password I used for mysql is not the typical password I used because my attempts to log in failed. watching this video I was told at 9:12 that the password would be set on installation but that turned out to be false. I was never asked for a password upon downloading but perhaps that is because I had part of mysql already downloaded on my computer but I did not have the workbench installed. All of my attempts to reset the password failed. So I then tried deleting mysql and redownloading. Now I am not able not to start the mysql server from mac's system preferences. But that's not my largest problem. I still cannot reset the password and hence even use the app. Following official mysql instructions I cannot reset the password because it requires the location of a pid file. It says
Stop the MySQL server if it is running. Locate the .pid file that contains the server's process ID. The exact location and name of this file depend on your distribution, host name, and configuration. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/.
In the folder for mysql located in /usr/local/var/mysql there is no pid file. A lot of the tutorials I've seen recommend using terminal but I cannot use terminal for mysql because I get the mysql command not found error. Ok, so to fix that problem trying this tutorial here it says:
If you’re installing MySQL using the official installer, then your MySQL bin/ folder should be located on /usr/local/bin/mysql
So now I need to find the mysql bin file but when I write ls in the /usr/local/bin folder, mysql does not come up. All of the file beginning near 'my' are
multinit
murge
nasm
So I'm stuck. I find it simply incredible that such a simple thing as resetting a password is so difficult.
Let’s say we installed MySQL version is 8.0 on our Windows OS. The bin directory is present at the following location −
C:\Program Files\MySQL\MySQL Server 8.0\bin

MySQL said: Documentation #2054 - The server requested authentication method unknown to the client

There are similar question in the thread but here I am obliged to mention this issue because being a newbie learner I couldn't figure out and resolve this problem. Sorry for my long English, I hope you care to help me.
By the way, I have the XAMPP Control Panel installed on my windows already and I had worked on to create few databases in the localhost/phpmyadmin (browser). Today, I had downloaded and installed MySQL-installer-community from this Link. I followed all the procedures to install it and configured it correctly.(The default port number was 33060 and I don't change that while installing the MySQL Installer).
But later by some reason I had to approach to my previous XAMPP Control Panel and tried to start APACHE and MySQL. APACHE was started but MySQL cannot be started and got terminated automatically. Later I found that MySQL in XAMPP Panel is running on same ports as I had not changed the port number while configuring the MySQL installer. So, I changed the default MySQL port number i.e. 3306 on XAMPP Control Panel to 3307 by making the changes in my.ini file as shown in the embedded image:
Changes on my.ini file
Later, while I restart the XAMPP Control Panel, MySQL starts without delivering any errors SEE HERE but still the Access is denied on the browser. For image, see this:
Access denied in the browser
However, through shell alongside, I can fetch the databases even though the access is denied in browser.
Accessing Database via Shell
Thus, I am seeking for the help on why can't I access the databases via localhost/phpmyadmin on the browser? Please guide me thoroughly!!
I found the solution on my own:
For this we have to go to the drive where the XAMPP is installed (for me it's C:\xampp). Then, we have to look for the folder phpmyadmin and click on that.
Inside the phpmyadmin, we have to look for the file config.inc and open with notepad or any other text editor. Look for the line $cfg['Servers'][$i]['host'] = '127.0.0.1:3306'; and change it to $cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
This works for me.

Local wordpress issues: Mac MAMP

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.

Cannot run mysql after moving data (Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist)

I come here from this topic
Where user has exactly the same problem.
I have installed Winamp (Apache+Mysql). I moved my /data subfolders (backup) to mysql/data (installed folder). I originally had error that my port is in use, so I changed to 3307. The cause for this error could be freeze of mysqld-nt (not closed, stayed in memory)
port is 3307
data folder is in my.ini is set correctly
client run results in close because mysql-nt doesnt run
mysqld-nt Freezes console.
cannot run console
mysqld-nt is closed (manually)
I am Windows user. My Mysql is part of Wamp server and has no any mysql_install_db
in bin folder. I don't use linux so I cannot use linux commands. Also I cannot run client bevazse server connection is not established so cannot type the command for client.
Please help.
The fact that port 3306 is in use could be a clue that your old Mysql server process is still running and hogging the port.
Because it's windows, you may have to reboot.
Your data backup might have been corrupted, or not copied over correctly.

Cannot install MYSQL on Windows XP

Man, is my stack overflowing!
I've tried about four times to install MySQL in a developer configuration on Windows XP. It fails with Error 1045. Access denied for user 'root'#'localhost' (using password NO). I go through the whole install app, it actually starts the service, then fails at "Applying Security settings".
There is no firewall running and I can access port 3306.
I get the following "helpful" hint.
If you are re-installing after you just uninstalled the MySQL server
please note that the data directory was not removed automatically.
Therefore the old password from your last installation is still needed
to connect to the server. In this case please select skip now and
re-run the Configuration Window from the start menu.
What is the "data directory"? I tried uninstalling completely. As far as I can tell, this removes nothing from the disk, only the registry. There is still a C:\Program Files\MYSql directory. OK, I deleted that whole thing and reinstalled. I searched for all files and folders named mysql. Nothing turns up after that deletion. I reinstall, and it's the same thing. How do I clean this up so I can reinstall? What OTHER data files are there to get rid of? Or do I need to reboot, or what?
And to think, the only reason I got into this was because I lost the root password.
Aargh!
C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\data
Get rid of that and you're golden. Of course you have to repair your installation afterward, or it won't work, but it does get rid of the previous password.
That's the data directory they're looking for. Nice of them to tell me.
I realize it's obnoxious to answer your own question, but on the other hand, I've spent a fair bit of time googling this without finding this answer.