I'm running Apache 2.2 and MySQL Workbench, and using PHP to access the database.
The problem is, when I try to open the database I've made, MySQL Workbench can't seem to connect to the localhost at port 80, and the program stops responding.
How can I fix this?
Update: After some time of the program simply not responding, it gave me this error message:
"Unhandled exception: Lost connection to MySQL server at 'waiting for initial communication packet', system error 10060 (code 2013)"
A wamp installation has a lot of issues. Instead, you can run a Virtual Machine with ubuntu and run there LAMP. it is way more reliable than running wamp that is not supposed to be "equal" in terms of your production environment - that for sure is linux based OS. Also, keep in mind that programs such skype blocks the port 80 and 443. Search what programs are using the port for mysql... that's why I don't develop AMP apps under windows, but under linux.
Related
I had installed MAMP on my windows 10 machine. I had then configured the MySQL thru the phpMyAdmin and had installed the WordPress. Later due to certain issues, I had to un-install and re-install the MAMP again. This time Apache started running and I could reach localhost/MAMP/, but when I click on phpMyAdmin, I get the message:
"mysqli_real_connect(): (HY000/2002) No connection could be made
because the target machine actively refused it
.....You should check the host, user name and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server". I ran the command> MySQL -u root -p status. It asked for a password. On giving the password, I got the following: Error 2003 (HY000) Can't connect to MySQL server on localhost (10061).
Please help with a workaround.
The error was resolved thru re-installation and taking care to disable the installation of MAMP Pro which happens by default.
I usually see the "actively refused" error when I try to connect to a port that the MySQL server is not actually running on. That said, I don't know why this would happen out of the blue. Maybe you should be using WAMP instead of MAMP?
You could probably troubleshoot this issue remotely with third party tools that have debug logging (MySQLShell through its Application Log)
Check all your Microsoft Redistribute Packages are installed correctly. If the problem exist then use the XAMPP or WAMP for the Windows because MAMP is generally used for the MAC OS.
between yesterday and today something happened that prevents processes running under Apache accessing an MSSQL server that is essential for functioning of the site.
This is what I find in the Apache error logs for PHP scripts:
PHP Warning: mssql_connect(): Unable to connect to server
Flask/SQLAlchemy applications are a bit more informative:
OperationalError: (OperationalError) (20009, 'DB-Lib error message 20009,
severity 9:\\nUnable to connect: Adaptive Server is unavailable or does
not exist (####:1234)\\nNet-Lib error during Permission
denied(13)\\n') None None
When I start the same WSGI app in test mode from the console on the same machine that Apache is running on, everything works. To summarize:
Both WSGI and PHP fail to connect to an MSSQL server literally overnight if run under Apache
When run w/o Apache, the WSGI scripts work fine (can't tell about PHP because that's not my domain)
Nothing was changed on the server that runs the web applications (can't say about the MSSQL server)
I need a clue quick. This stuff is running in a company intranet and people are getting impatient. I have control only over the RHEL server running Apache, not the MSSQL server.
The troubleshooting tips using tsql on the freetds page all work fine.
My /etc/freetds.conf is just out of the box and essentially empty (everything commented out).
Turns out it had nothing to do with Apache et al. This was an SELinux permission issue which started after the VM was rebooted during the night, probably initiated by a sysop in India. Apparently there was an updated security policy for apache. Found the issue in /var/log/messages, which thankfully even included instructions on how to fix it.
I am in the process of moving from PHP 5.6 to PHP 7.
I have a virtual machine running PHP 5.6 (PHP5) with MySQL running on it. The code is mounted from my host.
I have a second virtual machine running PHP 7 (PHP7). The code is also mounted from my host. All of my projects are configured with "localhost" as the database host.
As the first step, I want to have the MySQL "localhost" on PHP7 go directly to the PHP5 MySQL instance.
I have setup an ssh tunnel such that port 3306 on PHP7 goes directly to 3306 on PHP5, but this doesn't seem to help (EDIT: although if I change the config in a project to have a 127.0.0.1:3306 host it does work, but the host change is what I'm wondering whether I can avoid :) ).
Is there a way to setup the forwarding so that the projects will just work (or not), or do I need to go through each project and update it to cope with both servers?
I'm finding myself unable to connect to a MySQL server on my LAN using PHP, and only using PHP. Here's a breakdown of the situation.
My server is at 192.168.0.999 (well, except the 999 is in the 0-255 range of course). It's an Ubuntu server, where I have MySQL 5.5 running that I installed via apt-get.
I am using PHP 4 (no, unfortunately I cannot switch to 5 at this point) on Windows 7
I am connecting using mysql_connect() (and again, no switching to another API is not an option at this point). mysql_error() says: Can't connect to MySQL server on '192.168.0.999' (10061)
I can telnet to 192.168.0.999 port 3306 and although PuTTY gives me an error about packet order, there's quite clearly a MySQL server listening on that port.
I can connect by starting cmd and typing mysql -h192.168.0.999 -uusername -p, (of course my username is not actually 'username') and after I type the password I can run queries.
I've triple-checked the credentials in my PHP script for typos, so I am now quite completely stumped. I understand that error 10061 is a network error and that either MySQL or the box it runs on, is refusing my connection, but I cannot reconcile this with the fact that I can telnet to the very same host, and can connect easily with the standard mysql client on my machine.
Before anyone brings it up, AFAICT I've followed the troubleshooting steps in the MySQL manual to a T and the PHP manual does not seem very helpful. Copying the database to my local machine is very logical, and very desirable, but also very impractical.
Can anyone help me?
You've stated that you are running this on windows, and that you can access MySQL through command line but not PHP.
This sounds like permissions problems - are your table InnoDB by any chance?
If so, check the permissions on the InnoDB database files.
As it turns out, I was connecting to the right host, but to the wrong port. For reasons that are not really relevant to the question, my MySQL instance runs on port 3307 instead of 3306, so I've set mysql.default_port to 3307 in my php.ini file.
Mystery solved: PEBKAC!
I have an issue with a mysql database that randomly just go and die obviously. When this occurs and I try to use mysql in the terminal this occurs:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
What causes this? If I restart the service it works splendid until the next random occurance when it stops working again. Am all open for ideas.
You are not mentioned your OS, mysql version, XAMPP/WAMPP here. There are some reason for this error.
If OS is windows.
If you have installed XAMPP more than one in various driver of your system, this error may happen
If you installed skype, It may be using mysql default port 3306.
Clear your browser cache and try it.
Issue was memory related. The system killed processes for more essential parts.