Unknown MySQL server host 'loclhost' (-2) in popsql - popsql

when i try to create table, the running fails showing error "Unknown MySQL server host 'loclhost' (-2)" and in the schema trouble shooting error

Had the same exact issue. For some reason, re-tytping "localhost" in the connection settings for mysql in popsql and then setting connection type to "Connect directly from my computer" worked for me. Can't explain why, bbut it works

Related

.NET server stopped working

I was developing, and recompiled started my website with ctrl+F5 and got error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
How can this even happen?
I didn't changed anything.
I started empty MVC application and start it with CTRL+F5 and it works. I restart my main app, and still doesn't work. Damn.
Problem is, that I didn't change any connection string, anything in mssql server, didn't restart anything. I just compiled application like usual, and it said something about Antlr3 first, then couldn't connect to server anymore.. Changed the port for sql express and it started to work for a 20 minutes, and stopped working again.. don't understand.
this error threw for two type of problem .
1) Check your connection string for correct server Name and database Name ,etc..
Examble : Setting up connection string in ASP.NET to SQL SERVER
2) Check your sqlserver for open , if your sql server is there is any another system , please check your local network and another system network .
Please see this solution
Connect your SQL server from Visual studio > View > server Explorer,test and copy the connection string from there.It will work...My guess is you have a wrong connection string with wrong instance..
Is your database can be accessed outside the network. I think you need to add SQL server to firefall application to access it outside.
To add the sqlservr.exe to windows firefall
1. Go to Control Panel\System and Security\Windows Firewall\Allowed Programs.
2. Click Allow another Program.
3. Add SQL Server
Go to Control Panel -> Administrative Tools -> Services -> SQLServer . Check SQLServer to make sure it is started.
I forgot to put [InitializeMembership] attribute in my HomeController.cs, and it was looping forever because I was using RolesMembership ;)

Connection string with odbc connector

I am getting error
ERROR [08S01] [MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060.
While using connection string
"DRIVER={mysql odbc 5.1 Driver};SERVER=204.11.58.166;DATABASE=dbname;UID=uid;PASSWORD=uid;OPTION=3;"
So, please guide me how to solve it.
Thanks
Ravi
What MySQL version are you using ? ( To see the version you can use 'SELECT VERSION();' )
Is MySQL 64b or 32b ?
What is your OS ?
Try to update to ODBC 5.2, see on dev.mysql.com -> download -> conectors
Roberto Novakosky
Well I already have this in 3 situations
1) I was using old version of connection on Delphi, and with MySQL installed on Linux. I did update of my components and the connection was OK. (similar message)
2) In a remote application I used 'localhost' inside string connection, when must be the IP of server, on server works OK, but when I use from remote host this problem occurs. resolved with the real IP. (similar message)
3) In my LAN, the port 3306 was redirected to other machine, so when I tried to connect an outside server, the response connection was wrong. the message was exactly as yours. As, we can't to change the port of MySQL of outside server (that was 3306), I changed the port of my local MySQL server to 3307 and removed from my router the redirect over 3306. It was with conflict, see: I need to use 3306 from outside and it need to respond to my machine, the router hindered the connection ...
Good luck
Please refer this thread
and this site for detailed explanation

MySQL Windows service won't start

Our server is hosting a mix of asp and php websites. (windows server)
For months mySQL has been working unhindered and suddenly this has now stopped working.
I've tried connecting to MySql using the correct credentials which results in:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10055)
I've tried restarting the service using net stop MySql and net start MySql to no avail.
I have also tried using telnet localhost 3306 and telnet 127.0.0.1 and can confirm that the port is not acessible.
My hosting provider has inspected the step but is at a loss as to how we can remedy the situation. They have also inspected firewall settings and all seems to be correct.
find physical database files on disk.
back them up.
restard host computer.
then follow these steps:
Click Start, click Run, type regedit.exe, and then click OK.
Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
On the Edit menu, point to New, and then click DWORD Value.
Type MaxUserPort and then press ENTER.
Double-click the MaxUserPort value, and then type the maximum value in decimal or hexadecimal.
You must type a number in the range of 500065534 (decimal). Setting this parameter to a value outside of the valid range causes the nearest valid value to be used (5000 or 65534).
Click OK.
Quit Registry Editor.
restart host computer again. you should be fine now.
The issue is caused because IIS is complete garbage, and keeps consuming ports to connect to MySQL using ODBC. there is no max port value, so when all prots are used up, application crashes. You can solve this issue by following the stebs above, or by reviewing your asp.net application to use mysql connnect / net, instead of ODBC.

Application not connection to sqlserver outside the firewall

So I have an application that connects to our SQLServer.
This works on any server behind the firewall just fine.
When i put it out on our live server, outside the firewall the connection to the sqlserver fails with this error
A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The server was not found or was not accessible. Verify that the instance
name is correct and that SQL Server is configured to allow remote connections. (provider:
SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I know this is due to the firewall though the network admin claims the firewall is allowing it through (has even gone to the point of saying "your doing it wrong")
What can I do to see where it is failing exactly to see if it really is the firewall and prove to him that it is.
I am using the IP of the machine so it is not a DNS issue.
Any other ideas?
With all due respect, your admin is right by telling you you're doing it wrong, assuming if what you mean by "outside the firewall" means outside of your company's network. Something like a database server should never be exposed to external connections.
Edit: Never mind, this is a connection from the DMZ.
So the only thing I can think of is to try and telnet to that machine on port 1433 (while logged into the web server) and see if you get a connection error. You're not using SSPI so I don't think security would be the issue.
If telnet fails then you can take that to your network admin as proof that the problem is the firewall.
Are you using a named instance? Make sure SQL Browsing Service is running.
Usually when you connect to the default instance on your local server you use '(local)'. When it's a named instance you would use '(local)\InstanceName'. Or (local) is replaced by a host name or ipaddress.
When you use a named instance you could run into connection problems when trying to connect from a remote server.

Sporadic SQL Server error when trying to connect to the database

I will get the error below randomly when I'm running an asp.net application I am working on. Usually it will happen ever 3 days or so and I am forced to restart my machine to fix it but it's been getting worse and now a reboot dosn't seem to fix anything. I'm running the application on my machine and doing a lot of debugging. All interactions with the db are done through linq to sql. The db is on another server that I am connecting to. Has anyone run into this before? Any suggestions?
A network-related or instance-specific
error occurred while establishing a
connection to SQL Server. The server
was not found or was not accessible.
Verify that the instance name is
correct and that SQL Server is
configured to allow remote
connections. (provider: TCP Provider,
error: 0 - No such host is known.)
It may be DNS, try to use some different DNS addresses. :)
I've seen similar before but it was related to a faulty network card that was dropping packets. Have you had any other strange network problems?
In your connection string to the db is the host entered as a hostname or an IP address. If by name try swapping to its IP address instead. This won't solve the underlying problem by may workaround it for you.
Edit
Also have a look at this SO answer here. Are you leaving connections open/orphaning them? That would ring true with the disconnect happening at regular time intervals..

Resources