I have been working on php for some time. I have cloned a git repo yesterday. Just after that i am able to connect to MySQL server, access MySQL db and phpmyadmin properly. Today, I started the server and tried to access phpmyadmin from xampp control panel, as soon as I try to open it, apache port is changing automatically to 49868 and mysql connection terminates.Then, again apache changes its ports to previous states.
Any help is appreciated. Thanks in advance.
EDIT : I reinstalled everything and it worked.
Check if another application is using port 80.
In command prompt use:
netstat -aon | findstr :80
enter image description here
If windows verify if in task manager is already running XAMPP.
Related
Trying to setup a local Windows10 environment for Laravel 6 and need to connect with SSH to a remote linux mysql server.
Standard configuration doesnt seem to support a way to connect with SSH tunnels, but I did find a workaround that I need help finishing.
It seems the only way to get the connection going is through port forwarding, which I am able to do with gitbash/windows terminal
ssh -i /c/Users/MyUserName/MyKeyFolder/sitemaster_ssh -fNg -L 3307:127.0.0.1:3306 linuxUser#remoteHost.com
After running that manually in terminal / gitbash, I am able to use localhost with port 3307 successfully for my database configuration in Laravel and visit my site locally
Ideally, I would like to programatically check this port before laravel tries to access port 3307 on startup as well as some type of detection for later calls and reopen only if necessary.
I used this article which lays out the basics but is unclear as to whether the command line code can only be run manually
or if can be run with a script somewhere, somehow.
Laravel MySql DB Connection with SSH
I have tried doing things like
exec('ssh -i /c/Users/MyUserName/MyKeyFolder/sitemaster_ssh -fNg -L 3307:127.0.0.1:3306 linuxUser#remoteHost.com');
as well as putting in its own script nameed port_fwd_3307.sh and then running
exec('port_fwd_3307.sh');
I can navigate to the sh file from terminal and confirm it runs and the script is calling it from the proper directory, but still, I get no connection and no feedback as to whats going on other than server actively refused (but I know its a port issue, since it resolves successfully when run manually).
I have placed that command in the bootstrap/app.php file, as well as tried it in the config/database.php and public/index.php
before laravel even starts and none of this works.
Not sure if this is possible at all, but if it is, what specific part of the framework would it need to be located in to ensure the port is forwarded prior to the database connection?
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.
Bit stuck here, I have looked on here, for similar, but cant find what I need.
Have looked at how to start PHPmyAdmin via putty on here.
I have a server, which is on a network. I log into the network via Putty.
The database usual access is for example 10.32.187.100/m . This is how I used to access it before the server reboot.
I have had to restart the server. But I cannot log into the database as I believe I have to turn it on.
As it is not on a local machine I do not know how. It is a linux server, and the location of ‘m’ is /var/www/html
In ‘m’ are the files for phpmyAdmin.
Nothing has been over written. The server had to restart. Hence why I need to start up PHPmyAdmin.
Can I ask how do I turn on PHPmyAdmin via putty I the method I need to use?
try this
sudo service mysql start
sudo service apache2 start
I have installed XAMPP server in my C: drive.When i start apache service from control panel it starts successfully but when i start mysql service it freezes and does not start the service. I tried to start the service using services.msc it says the following error
The mysql service failed to start due to the following error: The system cannot find the file specified.
Anu Suggestions or help please i am stuck here.
I had the same problem do you have Skype on your computer try to change the port of Skype to another no or what you can do is install xampp in d drive and it will work cause some application is stopping it to work in c drive .
Hopefully this helps
As long as you can start it through the XAMPP control panel, I don't think you even need to worry about starting it through services. With MySQL running (after having started it through XAMPP), open a command prompt, and type this line:
mysql -uroot -p -P3306 -h127.0.0.1
If it appears to connect to MySQL, you're good.
I've installed XAMPP on my Windows XP. I started the XAMPP control panel and it shows apache and mysql are running.
When I check the status by going to localhost/xampp it shows:
mysql : deactivated
When I run php files that access the mysql database, it shows the following errors:
Warning: mysql_connect() [function.mysql-connect]: [2002] No connection could
be made because the target machine actively refused it. (trying to connect
via tcp://localhost:3306) in C:\xampp\htdocs\Elo_algorithm.php on
line 18
I've been through the XAMPP troubleshooting page and FAQ but I don't understand what to do. The XAMPP control panel shows mysql is running, but xampp status shows: deactivated.
What is going on here?
OK I got this issue resolved in my case, hopefully will help you too. Problem was system itself. If you run Vista, Win7, win8 you probably have permission issue. Simple go to XAMPP root and find mysql_start.bat and run it. Immediately after clicking your firewall will appear with message asking for permission. All you have to do is to allow permission (for private networks such a home or work network).
MySQL database ACTIVATED - and that's what matters ;)
I hope that helps to all of you who did not get an answer so far.
Cheers!
You should view in the xampp installation the file "\xampp\mysql\data\mysql_error.log".
This file contais the error log of MySQL and in it you can detect any problem like por in use.
For example, this lines of log show that the port 3306 (the mysql default) is used by another application and can't be accessed.
111130 8:39:56 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
111130 8:39:56 [ERROR] Do you already have another mysqld server running on port: 3306 ?
111130 8:39:56 [ERROR] Aborting
If all in the MySQL is correct probably the problem is related to the driver in the php application. Currently PHP has two MySQL connector types, the "mysql" and the "mysqli", MySQL "mysql" connector, that use "mysql_" (the method that you are using to connect is mysql_connect) prefixed functions, is used for old MySQL 4 applications and when the MySQL 5.x if is in configured with the "old password" parameter. The "mysqli" is used for the new mysql 5.x versions and in php you must use "mysqli_" prefixed functions like "mysqli_connect.
The version used by the lastest versions of xampp is MySQL 5.5 and you require to used the mysqli connector.
Check whether the value of port variable in the "my.ini" file in your xampp mysql folder is 3306 or 8888
i was facing the same problem. I had to run setup-xampp.bat to make it working.
By the way I came across a new WAMP stack called AMPPS. It looks quite easier than XAMP. You should try. http://www.ampps.com
I could not get XAMPP for Windows (1.7.4 Beta2--I know; ancient) to work on Windows 7 (32 bit) as the MySql would not "activate" or connect to Apache. Just by dumb luck I installed .NET Framework 4.6 for another application and suddenly--Whoopee! It started working!