MYSQL - Cant connect to MYSQL server on 'localhost' (10061) - mysql

Ive install wamp server on my PC(it has no internet or intranet connection, Windows XP -OS).
But when I access MYSQL this error popup.
Can you give any idea on how can i resolve this error.
thank you very much.
Cant connect to MYSQL server on 'localhost' (10061)

from the commandline (start/run/ type cmd, press ok), type:
telnet localhost 3306
If MySQL is running, you'll see the mysql version (and some garbage).
To see if the service is running, type:
sc query mysql
You'll see something like this if it's running:
SERVICE_NAME: mysql
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

To check to see if MySQL is running, provided its installed as a service you can go to Start -> Control Panel -> Administrative Tools -> Services (i may be a bit off on those paths, I'm an OS X / Linux user), and look for MySQL on that list. See if it is started or stopped.
You can then do a portscan if you really want to and determine if that port is open. There are all kinds of free tools online that will scan your IP and tell you which ports are open and what is listening on them.

Unless you did something during the install, I believe that the port will be standard and the service will NOT be running after install.
MySQL provides several GUI tools for managing servers: http://dev.mysql.com/downloads/gui-tools/5.0.html One of those tools is the "MySQL System Tray Monitor" which will detect the running service, and allow you to stop and start the server easily. You can also review the list of services for "MySQL" to see if that service is active.
If the service is running and you still can't connect, you need to make sure the Windows firewall is not blocking access to the port. If your firewall is not configured to notify you when it block a program (check the Windows Firewall control panel, it might not have notified you that it's detected the program).

Make sure it is running, check in my.cnf that it is really listening to the correct IP ( 127.0.0.1 ) and make sure you connect to the correct port aswell.
Try using telnet for debugging aswell and see where the problem lies, maybe mysql isnt started, or listens to a different port.

try to change a mysql port 3300 to "3306"

Related

Can't connect navicat to mysql

I have FreeBSD with mysql server and want to connect navicat with them. On vBox I have bridged network (192.168.0.225). I can ping to this from my system (192.168.0.135)
With ssh and ftp, it isn't a problem.
navicat error: 2003 -can't connnect to mysql server on 192.168.0.225.
10061 unknown error
It's a navicat's bug.
Delete the connection config where in navicat/servers/your-connection-name.
Then try to create a new connection and run.
It is likely, your mysqld is only listening on the local socket (/tmp/mysql.sock or some such). That's the most secure mode.
To make it more promiscuous, you'll need to configure the server to listen for TCP-connections as well.
Look for the bind-address setting in the [mysqld] section of /usr/local/mysql/my.cnf. You'll, probably, need something like
bind-address = 192.168.0.225
Consult this tutorial for more information on how to then authorize remote users -- MySQL allows configuring different passwords and access-policies depending on the where the connection is coming from.
You've probably disabled all apps from the service.
Click from start menu System Configuration
Click Services
Hide all Microsoft Services
Click following picture,which you install DB then enable and apply.

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 error 2005 - Unknown MySQL server host 'localhost'(11001)

I was using mysql 5.6.11,it usually turned down and show me this:
2005 - Unknown MySQL server host 'localhost'(11001).
Currently my resolution is to turn off the network,than it return to normal.I had searched a lot,but no answer is revalent to it.So,does anyone knows the reason?
ERROR 2005 (HY000): Unknown MySQL server host 'localhost' (0)
modify list of host names for your system:
C:\Windows\System32\drivers\etc\hosts
Make sure that you have the following entry:
127.0.0.1 localhost
In my case that entry was 0.0.0.0 localhost which caussed all problem
(you may need to change modify permission to modify this file)
This performs DNS resolution of host “localhost” to the IP address 127.0.0.1.
I have passed through that error today and did everything described above but didn't work for me. So I decided to view the core problem and logged onto the MySQL root folder in Windows 7 and did this solution:
Go to folder:
C:\AppServ\MySQL
Right click and Run as Administrator these files:
mysql_servicefix.bat
mysql_serviceinstall.bat
mysql_servicestart.bat
Then close the entire explorer window and reopen it or clear cache then login to phpMyAdmin again.
The case is like :
mysql connects will localhost when network is not up.
mysql cannot connect when network is up.
You can try the following steps to diagnose and resolve the issue (my guess is that some other service is blocking port on which mysql is hosted):
Disconnect the network.
Stop mysql service (if windows, try from services.msc window)
Connect to network.
Try to start the mysql and see if it starts correctly.
Check for system logs anyways to be sure that there is no error in starting mysql service.
If all goes well try connecting.
If fails, try to do a telnet localhost 3306 and see what output it shows.
Try changing the port on which mysql is hosted, default 3306, you can change to some other port which is ununsed.
This should ideally resolve the issue you are facing.
Follow these steps to fix this error
Use \connect root#127.0.0.1 instead of \connect root#localhost
if it doesn't work then go to C:\Windows\System32\drivers\etc\hosts and check the IP address attached to host name.
use that IP, so it will be.
\connect root#the_ip_address_you_found

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

I am having window 7 as a operating system in the production machine where i am trying to use MySQL server 5.0 as a database. But i am unable to configure MySQL on my production machine. Following is the error i am receiving.
The security setting could not be applied to the database because the connection has failed with the following error:
Error no. 2003
Can't connect to MySQL server on localhost (10061).
The message also prompts that you need to open TCP 3306 port to resolve this issue, i checked it and found that TCP 3306 port is already opened and state is listening.
This is my 'netstat -an' command result -
Proto LocalAddress ForeignAddress State
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING
It means TCP at 3306 is open. Can anyone please tell me the solution of this problem. However i am able to install and configure the same MySQL Server setup in window xp. I tried google as well and found a lot of blogs but none is of use.
Thanks a lot.
Change
host: localhost
to
host: 127.0.0.1
This is likely caused by the way your database is being resolved.
have you checked whether the port 3036 is already in use by another application?
Have you checked whether a telnet hostname 3036 works on the local MySQL server and also on the remote machine?
First check in the system, MySQL services is in running condition or not.
look out on path of services go to right click on My Computer > manage > Services and Application > Services and check MySQL service status is started or not. Otherwise right click on service and start to service.
I hope this will help you.
I didn't find the MySQL services even after solving the problem.
I just run the mysqld as administrator and the problem is solved. So, simple but It took me 3 hours to find the solution.
The problem was rsolved.
The MySQL was not running in the Services section of Settings. Because XAMMP had disconnected the already running application in the background.

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