MAMP downloads file when trying to access PHPMyAdmin - mysql

I have just installed MAMP and I'm trying to access PHPMyAdmin by going to http://localhost:3306/MAMP. This will just start downloading a file called MAMP with the following content:
J
5.5.42
`q6X9T{1ˇ˜Ä~H.KolO)zP_jmysql_native_password!ˇÑ#08S01Got packets out of order
If I change to ..:3306/PHPMyAdmin it just downloads a file with PHPMyAdmin as a title and similar content.
I have changed the MySQL-port to 3306 (and the Apache port to 80) because I'm using VirtualHostX for adding virtual hosts.
I can see in my MAMP-window that MySQL Server is running (the box is green) but Apache Server is not. What am I doing wrong? How do I get Apache Server to run?

By going into the terminal and entering sudo apachectl stop I stopped Apache and could start it up from the MAMP-window without any trouble.

Related

Trying to Start MySQL Server and Getting "Could not start server: argument 2: <class 'TypeError'>: wrong type"

I just installed MySQL using the community installer in hopes of running a server and creating a database for use in my C++ program. I installed the Server, Workbench, Shell, Router, and Connector/C++ before running the Workbench. Everything appeared to be working properly. The server was running and I was able to connect to it in my C++ program, so I started to create my database, when the power suddenly went out before I could finish.
Once the power came back on and my PC rebooted, I reopened the MySQL Workbench to find that I was unable to start the server. I clicked the 'Start Server' button several times, but was met with the error "Could not start server: argument 2: <class 'TypeError'>: wrong type".
I tried uninstalling and reinstalling everything, but when I reopened the MySQL Workbench after the installation was finished, I was met with the same error. Does anyone know what could have possibly happened?
EDIT: After uninstalling everything and deleting every trace of MySQL from my computer, I was able to reinstall everything and get the server running again. However now I'm getting the same error when I try to STOP the server: "Could not stop server: argument 2: <class 'TypeError'>: wrong type". What is going on????
I have the same issue and I've installed the developers default version of the MySQL-Workbench with the installer. I recently updated my hardware and reinstalled Windows 10, maybe it's a bug of Windows 20H2 or of the Workbench itself?
I found a workaround: Use the CMD or the Powershell to start or stop the MySQL-Service of the server. In my case, it has the name MySQL80. Take a look in your services of windows when the commands below are not working.
Use net start MySQL80 to start the server.
Use net stop MySQL80 to stop the server.
Remember to open the CMD or the Powershell as Administrator. I think this issue is a bug of the workbench itself because the service is start and stopable with the command line.
The first thing to try is to run mysqld --console from the MySQL server bin folder. That should give you more specific error messages.
In my case, the data folder was missing. I needed to run one of the mysqld --initialize... commands; see https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html. On Windows, running mysqld --initialize... --console helps to see what server is doing.
Once that's done, you can run mysqld --console again to see if it starts successfully.
I solved this problem as follows. currently my.ini file encoding is UTF-8. you must change to ANSI.
I've done numerous suggestions and none work. Except this one:
Download and run the latest MySQL Installer.
A window will appear showing your installed services:
MySQL Server
MySQL Workbench
MySQL Shell
etc.
Click "reconfigure" on the MySQL Server and set up the server as you did previously.
My specific server setup was:
Type and Networking: leave as default
Authentication Method: (RECCOMENDED)
Accounts and Roles: Enter and check mysql password
Windows Service: Uncheck 'configure as a service'
Apply configuration: Execute
Server should be up and running.
in my case I had solve this way
Go to RUN----->Services.msc----->MYSQL80---->start server
hope this way problem will solved.
On my Windows installation the account the service runs under did not have (security) permissions to the non-existing data directory. After creating the data directory which was "Program Files\MySQL\MySQL Server 8.0\data" and setting permissions everything worked with a "net start mysql80".
Here are the steps I took to resolve my MySQL Workbench 8.0.23 issue
that resulted in an inability to start & stop the MySQL server process (mysqld)
from MySQL Workbench (O/S=Windows only answer)...
Close MySQL Workbench
In C:\Users<Your account>\AppData\Roaming\MySQL\Workbench\serverinstances.xml:
Replaced:
sc start MySQL80
sc stop MySQL80
With:
net start MySQL80
net stop MySQL80
Notes:
My mysqld service was installed w/ the name='MySQL80', replace/match this value to your actual service name.
My mysqld service was installed using a 'Network Service' account, verify that your service is also running as a network service before using the 'net' commands
Setup MySQLWorkbench CE 8.0 executable to 'Run As Administrator' so that the commands to start and stop the service run as an administrator:
In File Explorer find the MySQLWorkbench.exe executable:
E.g: C:\Program Files\MySQL\MySQL Workbench 8.0\MySQLWorkbench.exe
In File Explorer, Select the exe, Right click on the exe, select 'Properties', select
'Compatibility' tab: specify 'Run This Program As An Administrator'
Start MySQL Workbench
Attempt to start or stop the MySql server process (mysqld)
Notes:
O/S = Windows 10 specific
MySQL & MySQL Workbench were installed via the MySQL CE 8.0.23 installer
Installed MySQL 8.0.23 as an upgrade from 5.7 to 8.0.23
If this error while starting/connecting the server from Workbench then you need to Go Start->MYsql workbench Installation Click.
Open and reconfigure the MySQL server with port number and Create Root user Password.
Finish this Re-configuration then open workbench. Provide the Port number and Credentials and connect to DB.
In window you may use task manager
just open task manager by search "task manager" in window search
Go to service and find Mysql (name depending on the name saved when initializing mysql server at first time)
Right click it and click start to start server or stop to stop server

Can't Connect to MySql Database via Node.js [duplicate]

I installed XAMPP v3.2.1 because I wanted to learn how to create database in MySQL and learn more about TOMCAT. However, I am a little confused about what to do now. I have read many blogs and the documentation on this page http://dev.mysql.com/doc/refman/5.0/en/creating-database.html.
While following the directions I found that:
I can't access my local host.
Attempted Solution: I shut down skype because I read that might be an issue.
I don't have any older versions of XAMPP on my computer and I don't believe I am connected to any other servers. So, I don't have permission to do anything.
OR
Am I trying to access mysql through the wrong command prompt? I am trying to use MySQL from the XAMPP shell. I am not sure why I cannot get everything working. Am I going about this the wrong way?
Thanks for any help
XAMPP only offers MySQL (Database Server) & Apache (Webserver) in one setup and you can manage them with the xampp starter.
After the successful installation navigate to your xampp folder and execute the xampp-control.exe
Press the start Button at the mysql row.
Now you've successfully started mysql. Now there are 2 different ways to administrate your mysql server and its databases.
But at first you have to set/change the MySQL Root password. Start the Apache server and type localhost or 127.0.0.1 in your browser's address bar. If you haven't deleted anything from the htdocs folder the xampp status page appears. Navigate to security settings and change your mysql root password.
Now, you can browse to your phpmyadmin under http://localhost/phpmyadmin or download a windows mysql client for example navicat lite or mysql workbench. Install it and log in to your mysql server with your new root password.
XAMPP Apache + MariaDB + PHP + Perl (X -any OS)
After successful installation execute xampp-control.exe in XAMPP folder
Start Apache and MySQL
Open browser and in url type localhost or 127.0.0.1
then you are welcomed with dashboard
By default your port is listing with 80.If you want you can change it to your desired port number in httpd.conf file.(If port 80 is already using with other app then you have to change it).
For example you changed port number 80 to 8090 then you can run as 'localhost:8090' or '127.0.0.1:8090'
Changing XAMPP Default Port:
If you want to get XAMPP up and running, you should consider changing the port from the default 80 to say 7777.
In the XAMPP Control Panel, click on the Apache – Config button which is located next to the ‘Logs’ button.
Select ‘Apache (httpd.conf)’ from the drop down. (Notepad should open)
Do Ctrl+F to find ’80’ and change line Listen 80 to Listen 7777
Find again and change line ServerName localhost:80 to
ServerName localhost:7777
Save and re-start Apache. It should be running by now.
The only demerit to this technique is, you have to explicitly include the port number in the localhost url. Rather than http://localhost it becomes http://localhost:7777.
<?php
if(!#mysql_connect('127.0.0.1', 'root', '*your default password*'))
{
echo "mysql not connected ".mysql_error();
exit;
}
echo 'great work';
?>
if no error then you will get greatwork as output.
Try it saved my life XD XD

xampp MySQL does not start

I installed Xampp on Windows 7 32-bit. When I try to start MySql in XAMPP control panel (v3.2.1) I have the following message and MySql does not start.
23:02:03 [mysql] Problem detected!
23:02:03 [mysql] Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" MySQL"!
23:02:03 [mysql] MySQL WILL NOT start without the configured ports free!
23:02:03 [mysql] You need to uninstall/disable/reconfigure the blocking application
23:02:03 [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
23:02:03 [mysql] Attempting to start MySQL service...
A similar problem was reported here but there is no working answer. When I try to install with MySql disabled, the result is that I even don't have an option even to try to run it.
I am new to Xampp and don't know where and what to look for to solve the issue
I need to run Apache and MySql with Php.
You already have a version of mySQL installed on this machine that is using port 3306. Go into the most recent my.ini file and change the port to 3307. Restart the mySQL service and see if it comes up.
You also need to change port 3306 to 3307 in xampp\php\php.ini
You have two versions of mysql using the same port 3306.
Change the port by:
Stop the xampp server, if it is already running.
Edit the value to "port" in xampp/mysql/bin/my.ini
Here:
# The following options will be passed to all MySQL clients
[client]
Password = your_password
port = 3306 #---> 3307
socket = "/ xampp / mysql / mysql.sock"
and also here:
The MySQL server
[ mysqld ]
port = 3306 #---> 3307
socket = "/ xampp / mysql / mysql.sock"
2. Start mysql service
I found out that re-installing Xampp as an administrator and running it as an Administrator worked.
Try this: really quick + worked for me:
Open Task Manager > Services Tab
Find "mysqlweb" service > right-click it to stop service
Launch Xampp again
ps: excuse image below for different language :)
Google Brings me here. The favourite answers don't help me.
I've now solved it, so maybe this will help someone else.
Problem: after UPDATE of XAMPP to a new version I get the message "MySQL WILL NOT start without the configured ports free!".
However, I only have 1 instance of mysqld running.
It seems that the control panel is not as clever as it looks. As far as I can tell, the single instance of mysqld is the new one i've just updated to, but running as a 'service'. The control panel then tries to start it, and instead of realising its already running, It assumes its another service and reports the error.
Probable cause: The uninstaller failed to remove the autostart property from the mysql service, so the new instal picked it up.
Solution:
open the Xammpp Control Panel and click on the Services Button on the right. This will open the services control panel.
Look for mysqld in the list of running processes, right-click it to get the properties and change the startup type to "Manual".
you might as well do the same for Apache2 while you're here.
Apply changes and Close the services control panel.
Now click the Config Button on xampp control panel, uncheck The Mysql (and Apache) Autostart features.
Reboot the machine.
You should now be able to start / stop Mysql & Apache without any error messages.
If this works, use the Xampp Control panel as usual to start/stop add service or add autostart as normal.
No need to mess with any ports or config files.
If there are two instances of MySql it's normal that it gives such an error if they both run at the same time. If you really need 2 servers, you must change the listening port of one of them, or if you don't it's probably better to simply uninstall one of them. This is so regarless of MySql itself, because two programs cannot listen on the same port at the same time.
Same issue on macOS and got it fixed by running the same installer again.
Whereas I COULD NOT get it fixed by
Changing port
Rebooting XAMPP
Restarting system
Note:
Make sure to select 'XAMPP Core Files' component while running the installer as by default it is not selected.
Though re-running the installer is not smart option when one has to do it every now and then. My installer is xampp-osx-7.0.13-1-installer.dmg
Update: I've got my MAMP working with this simple solution here. So, same should work for XAMPP.
If you have previously installed MySQL Workbench the problem is that another MySQL instance is running at 3306 port.
So uninstall MySQL and XAMPP and after that, reinstall only XAMPP.
This worked for me.
So if you are on a Windows machine, you can open the task manager. Check the processes list, and delete the mysqlId from it. Restart the xampp. It will work fine.
You need to uninstall/disable/reconfigure the blocking application that is using the port 3306. But, if for some reason, you can't do the above maybe because you need the other application too, then follow these steps to change the MySQL port to 3307.
Stop the Apache Server from XAMPP Control Panel (if running)
Now open XAMPP Control Panel => Config (Top Right) => MySQL and change the Main Port to 3307 => Save => Save
Click Config of MySQL (From Control Panel only) => my.ini and then Change all the occurrences of 3306 to 3307 (Search using ctrl + F and replace all)
Click Config of Apache (From Control Panel only) => config.inc.php and then search for the line: $cfg['Servers'][$i]['host'] = '127.0.0.1'; (present at 27th line in my file). Now add this below the line you found (at line 28 according to my file): $cfg['Servers'][$i]['port'] = '3307';
Now, you are good to go. Also note that you would have to change port for all your projects to 3307 for them to work properly. For eg: from $servername = "localhost"; to $servername = "localhost:3307"; in the database config file of your project.
I hope this works for you too.
My fix was to stop MySQL57 in services, Xampp now starts/stops Apache/MySQL as expected.
The is a simple and faster way to solve the problem.
You don't need to open a services or write any cmd code just follow my steps:
from XAMPP control panel click Explorer button
from directory find mysql_stop.bat file and run it.
Thats all!! super easy.
Refresh your netstat list, you will see that it has gone.
please make it as best answer.

MySQL Workbench Will not connect to localhost. "Database server instance is unknown"

My MySQL Workbench is not connecting to my local host, and I cannot figure out why exactly it is reacting like this. It just started doing this one day, and randomly it will give me access although it says it is still "unknown", but I am tired of this and would like to fix it.
Since this website reqires that I have a "10" reputation to post images, I will have to describe it.
On the Startup/Shutdown tab in the administration page, it says:
The database server instance is unknown. --The "Start Server" button is faded out so that I cannot click it.
Startup Message Log
2013-07-11 08:57:51 - Workbench will use cmd shell commands to start/stop this instance
2013-07-11 08:57:51 - Status check of service 'MySQL' returned error: Not found
2013-07-11 08:57:51 - Status check of service 'MySQL' returned error: Not found
2013-07-11 09:00:55 - Status check of service 'MySQL' returned error: Not found
2013-07-11 09:00:55 - Status check of service 'MySQL' returned error: Not found
2013-07-11 09:02:01 - Status check of service 'MySQL' returned error: Not found
Then on the server status tab in the administration page, it says:
Name: mysqld#localhost
host: localhost
server:unknown
status: unknown
Connection
There is no connection to the MySQL server. This functionality requires an established connection to a running MySQL server to work.
If anyone can help out, that would be great!
Thanks
I had this problem on my Windows 8.1 machine and it turned out to be problems with the file permissions.
To repair it I went into the folder at "C:\Program Files\MySQL\MySQL Server 5.6" and right clicked on the "data" folder and selected properties. Clicked the security tab and clicked edit. From there click the ADD button then the ADVANCED button and finally the FIND NOW button. In mine I added users, administrators, and "ALL APPLICATION PACKAGES". I granted full control to the users that were already listed for the data folder and the users, administrators, and ALL APPLICATION PACKAGES.
After the permissions were repaired I opened a command prompt as administrator and changed to the "C:\Program Files\MySQL\MySQL Server 5.6\bin" directory cd "C:\Program Files\MySQL\MySQL Server 5.6\bin". From there you can execute mysqld --install which installs the MySQL service.
More information about installing the mysql service on windows can be found at http://dev.mysql.com/doc/refman/5.0/en/windows-start-service.html
[edit] Please note that if you are using a different version of MySQL than the path to the MySQL data directory and bin directory may be different on your windows machine.
The error message says it: the service with the name MySQL cannot be found. So probably your MySQL service has a different name? Do you have a service at all? Starting mysql manually from the bin folder is just that: manual. There is no service involved, hence WB cannot manipulate the run state.
When you install MySQL with the MySQL installer you have everything in place within a couple minutes and it works right from the start.
So first check if you have a service running for your MySQL server and stop starting it manually. If there's a service take its name and enter it in the Windows Service Name field of the configuration manager:
Note that MySQL Workbench can manage your server only if it is installed as a Windows service.
I had this problem on my Windows 8.1, and I solved it updating my workbench to Version6 with "mysql-installer-web-community-5.6.16.0.msi" from the official page of mysql
I have found reinstalling all MySQL products a better alternative, because some of the solutions on the internet will make another instance of your mysql server along with mysql56, which might mess things up for a beginner.
Remember to keep database files and configuration undeleted during the reinstallation.
I had problem on MAC.
Please ensure you have installed mysql and its running. Because installing only workbench app, will not install mysql service. First install mysql and run the service.
In my case, I tried with brew
brew install mysql // installing mysql
brew services restart mysql // restart service after installing
mysql --version // check version

Can't connect to MySQL server on 'localhost' (10061)

I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to "Applying Security settings", at which point it gave me the above error (Can't connect to MySQL server on 'localhost' (10061)).
I do have a port 3306 exception in my firewall for 'MySQL Server'.
Got this error on Windows because my mysqld.exe wasn't running.
Ran "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --install from the command line to add it to my services, ran services.msc (start -> run), found the MySQL service and started it.
Didn't have to worry about it from there on out.
To resolve this problem:
go to the task manager
select Services tab
find MySql service
Running
That's all.
You'll probably have to grant 'localhost' privileges to on the table to the user. See the 'GRANT' syntax documentation. Here's an example (from some C source).
"GRANT ALL PRIVILEGES ON %s.* TO '%s'#'localhost' IDENTIFIED BY '%s'";
That's the most common access problem with MySQL.
Other than that, you might check that the user you have defined to create your instance has full privileges, else the user cannot grant privileges.
Also, make sure the mysql service is started.
Make sure you don't have a third party firewall or Internet security service turned on.
Beyond that, there's several pages of the MySQL forum devoted to this:
http://forums.mysql.com/read.php?11,9293,9609#msg-9609
Try reading that.
I had difficulty accessing MySQL while connecting via a localhost connection on the standard port 3306, which worked fine when I installed and configured it for prior classes I had taken in MySQL and Java. I was getting errors like "error 2003" and "Cannot connect to MySql server on localhost (10061)". I tried connecting from both MySQL Workbench (5.2.35 CE) and Netbeans (7.2). I am using Windows 7 64 bit professional.
I tried typing in services.msc in the start menu search box, which opened the services dialog box to show all the services installed in windows. I scrolled down to MySQL and started this service. Subsequent attempts to connect to MySQL from MySQL WorkBench and from the command prompt succeeded.
English:
press Windows + R
write "services.msc". Then press Enter
search for MySQL57 and right click
click on start the service
Français :
Appuyez sur la touche Windows + R
Écrire "services.msc" Puis appuyez sur Entrée
Recherchez MySQL57 et clic droit
Cliquez sur rédémarrer
press Windows key + R
write "services.msc" enter
search for "MYSQL56"
write click on it and start the service
Make sure that your windows host file (located at c://windows/system32/drivers/etc.host) has following line. If not, add it at the end
127.0.0.1 localhost
::1 localhost
Sometimes mysql can not trigger Windows to force start host services if firewall blocks it, so start it manually
win+run>>services.msc, select the "MySQL_xx" where "xx" is the name you have assigned to MySQL host services during setup. Click on 'start' to start from hyperlink appeared on left side.
I tried Kuzhichamadam Inn's solution and found that a slight change needed to be made.
MYSQL57 was a network service. I had tried this repeatedly with no success. When I opened services.msc I found another service for localhost: MySQL. I started that one using the process below and it worked.
run > services.msc > rightclick MySQL > properties >start
I got this error when I ran out of space on my drive.
Go to Run type services.msc. Check whether or not MySQL services are running. If not, start it manually. Once it is started, type MySQL Show to test the service.
To connect locally to MySql, you do not have to setup a firewall with inbound rules. But, even if you already setup iptables to allow the TCP inbound port 3306 and grant the privilege to the user to access the db locally, you may have to setup the bind address in your my.cnf file, edit the default address there and put the server IP address that is running the MySql service.
Since I have struggled and found a slightly different answer here it is:
I recently switched the local (intranet) server at my new workplace. Installed a LAMP; Debian, Apache, MySql, PHP. The users at work connect the server by using the hostname, lets call it "intaserv". I set up everything, got it working but could not connect my MySql remotely whatever I did.
I found my answer after endless tries though. You can only have one bind-address and it cannot be hostname, in my case "intranet".
It has to be an IP-address in eg. "bind-address=192.168.0.50".
run > services.msc > rightclick MySQL57 > properties >set start type option to automatic
after restarting computer
At cmd
cd: C:\
C :\> cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"
it will become
C:\Program Files\MySQL\MySQL Server 5.7\bin>
type mysql -u root -p
ie C:\Program Files\MySQL\MySQL Server 5.7\bin> mysql -u root -p
Enter password: ****
That's all
It will result in
mysql>
Another possibility:
There are two ways the MySQL client can connect to the server: over TCP/IP, or using sockets. It's possible you have your MySQL server configured to support socket connections, but not network connections.
Nothing to do just "Reset to Default" your firewall setting it will start working.
I read many solutions but nothing worked properly, so at last I reset firewall settings which worked.
finally solved this.. try running mysql in xammp. The check box of mysql in xammp should be unclicked. then start it. after that you can open now mysql and it will now connect to the localhost
Edit your 'my-default.ini' file (by default it comes with commented properties)as below ie.
basedir=D:/D_Drive/mysql-5.6.20-win32
datadir=D:/D_Drive/mysql-5.6.20-win32/data
port=8888
There is very good article present that dictates commands to create user, browse tables etc ie.
http://www.ntu.edu.sg/home/ehchua/programming/sql/MySQL_HowTo.html#zz-3.1
I did not have Mysql server installed, that package was missing and I got it from this link https://dev.mysql.com/downloads/installer/
Right click on My Computer
Click on Manage
Go to Services and Application
Select Services and find MySQL service
Right click on MySQL and select Start