MAMP Unable to Connect to MySQL on localhost (10061) - 2017 - php

I'm trying to create a dynamic drop down list by requesting data from my database using MAMP.
One of the tutorials I have tried has been talked about already and my version of the code is the same. Dynamic dropdown list with PHP & MYSQL
Although I am under the impression MAMP has a SQL server, I thought the problem was because I didn't have MySQL installed on my computer so I downloaded it, to no avail.
I went into my Task Manager and tried looking for "MySQL service" although I couldn't find the exact tag I did see MySQL Writer is running, but the Browser and Agent INFLOW is not and refuse to start.
I went here into my computer ( c://windows/system32/drivers/etc.host ) and took off the #s that were before
127.0.0.1 localhost
::1 localhost
making sure each remained on a separate line, I restarted my computer but I still can't seem to connect.
Any suggestions on how I may be able to fix this? I am extremely new to PHP and even newer to MySQL so, if possible, please try to keep any solutions simplified so I can follow along.

Not sure what the issue actually was but I ditched MAMP and installed XAMPP and everything seems to be working now.

Related

Webadmin and php are not working correctly

I have ubuntu server 16.04 running within hyper-v on a Windows 10 computer. I am running LAMP with Apache2, MariaDB, and PHP7.0. I have installed phpmyadmin but when I attempt to call it through my browser I get text, I'm assuming that it is the correct file but it is obviously not outputting the program. These are screenshots of what I'm seeing:
I am stuck at this point and have tried doing just about everything. I've entered the Include statement, as well as configured, updated, and upgraded everything. I started out using mysql but MariaDB seems to be working better. I just want to get phpmyadmin up and working and to put my websites up on the internet. Any help is appreciated.
After doing everything that is listed, I had rebooted and tried accessing phpmyadmin with success, so I'm at loss for words.

Fixing a PHP database connection failure with updated MySQL library

I spent some hours trying to solve a migration from CentOS 5.5 to 7 in which everything worked except PHP-based sites connecting to the MySQL server for a Web site. Perl worked fine. CLI commands worked fine. I tried every solution listed on Stack Overflow and elsewhere:
Make sure /etc/hosts contains localhost as the first entry for 127.0.0.1
Check that PHP is correctly pointing to the right socket
Try swapping localhost and 127.0.0.1 in the connection setup
Checked php.ini for any settings that differed between my functional CentOS 5.5 setup and the new stock CentOS 7 installation.
Annoyingly, I couldn't get PHP to dump errors, whether via Apache or elsewhere. It was all maddening.
After checking for the fifth time that I had the right drivers installed, I realized that there are two CentOS/yum packages: one is php-mysql; the other is php-mysqlnd, a native driver.
Uninstalling php-mysql, which is apparently outdated, but which is what I used in CentOS 5.5, and installed php-mysqlnd instantly fixed the problem.
I have been unable to find any other answers of this sort, so perhaps my situation is unique. But I wanted to document it in case someone else came across the same migration issue.

#1045 Cannot log in to the MySQL server

I installed Apache, MySQL, PHP, and phpmyadmin, and I did everything needed to make the localhost/phpmyadmin webpage work correctly, with the two user inputs, I remember making my password and username 'root', when I try to log in, I get the error in the title. I've have been searching for an hour for a solution, but nothing has worked for me, please someone help, this is so frustrating! Thanks in advance
PS. I also installed 'xampp' to start and stop mysql server (that's all I know how to use it for)
I assume you have not been able to put any valid data into your MySQL database. Therefore
you should definitely remove Apache, MySQL, PHP, and phpmyadmin, plus XAMPP; then restart your machine and install just XAMPP.
Getting all the necessary parts working together is tricky, that's why there are packages like XAMPP that do the work for you.
So you haven't managed to connect to the MySQL server through php myadmin, just get to the login screen?
The way you have phrased you question makes it sound like you've installed MySQL and php seperatly from xampp, is this the case as I believe that xampp comes with it's own versions?
You are on windows??

I am really confused and frustrated about my php website and mysql connection

So basically I've created a MYSQL database that holds information about a gaming server player information, it's loaded into this PHP website that I created just 2 days ago (I'm completely new to PHP, I only started experimenting on it 2 days ago). So I had it all fixed up but on a localhost, it could fetch the data from the mysql database but only in the localhost, today I wanted to host a free mysql hostname is: fdb3.runhosting.com username: 1141497_damagedz and ofcourse I know the password. But when I'm trying to type this in via my PHP code in the db_connect line it gives me error saying it fails to connect at line 13 which is the line of $db_connect line, before it did work under the localhost but just now it doesnt work because I've deleted 3 files from xampp but surely that shouldnt matter now since its hosted on a whole different place like fdb3.runhosting.com ??
Also I'm using Adobe Dreamweaver to make the PHP website, before I just had to type in
http://localhost/tester.php
to open up my tester.php website that I've been working on, but now after I deleted the xampp it wont open this so I can't really tell what I'm doing or does it work or not, this is after I deleted my xampp, which is after I deleted my 3 files from xampp. So you can see i'm really confused and I do not know how to fix this at all, I don't know why db_connect at php gives me errors when clearly my fdb3.runhosting.com mysql database works just fine... I've created tables there too. Also how may I run my tester.php file without the localhost? Please tell me I'm really confused and really need help, thank you!
"I've deleted 3 files from xampp but surely that shouldnt matter"
Which 3 files and how do you come to that conclusion? Everything you say tends to indicate the reverse to be true!
Re-install XAMPP is the logical first option. Backup your htdocs folder then re-install. Don't know if you'll need the backup or not (I suspect not)
I agree with David.
It is highly unlikely you can use the remote database at fdb3.runhosting.com using PHP scripts on your local computer. XAMPP includes a MySQL database server and had you not deleted phpMyAdmin you would be able to use that to browse the databases on it.
Develop the website on your local XAMPP install and local XAMPP database, then export the database to the remote host and copy the files across when you are ready to view it online.
It's also worth keeping the XAMPP install folder and others because it contains information on XAMP and I believe allows you to check whether the version you're running is the latest one.

MySQL problem reconnecting (mysqld.exe) keeps giving error

Need some guidance figuring out what went wrong. I've been using mysql, phpmyadmin for just under a year on my home computer while I develop a webapp. 3 days ago I updated my windows vista with all the "wonderful" microsoft updates, security patches, etc...and now it's broke. I tried uninstalling all the upgrades, but there are 4 of them I can't unistall because microsoft says their "operating system" updates and can't be unistalled.
My system is: windows vista, php 5+, mysql 5.1, Apache 2+.
I can run my web app and it queries the database without any problems. However, when I run phpmyadmin to get into the database I get an error: "mysqld.exe has stopped working" and phpmyadmin crashes. I tried going to the command line for mysql to do a mysqldump to backup my database and it gives me an error "2013, could not connect to the server". If I restart the computer the webapp will work again. Basically, php can query the database, but if I try to get at the database through phpmyadmin, or the command prompt the mysqld.exe error occurs and blows mysql out.
Any ideas what's going on here? Any ideas how to get around this to backup the db, so I can reinstall mysql?. I'm really lost where to start. I don't really know if the updates caused the problem, or if the 4 updates that can't be unistalled are really the problem.
Any tips will be appreciated. thanks.
You could try using XAMPP. It has PHP, MySQL, Apache, and other stuff all in one easy to use package.
After a software/ hardware drivers update, it may happened that the service mysqld.exe crashes at each launch (usually with message: mysqld.exe encountered an error and needs to close)
Check the solution described here (it worked for me) if you wish to avoid mysql reinstall.

Categories