user3138606
user3138606

Reputation: 11

2005- Unknown mysql server host'localhost'(0)

I was using navicat for mysql to connect to mysql 5.5.25,it usually show me this:2005 - Unknown MySQL server host 'localhost'(0).Currently my resolution is to turn up the network,then it return to normal.but when network is not up,it shows that error,I had searched a lot,but no answer is revalent to it.So,does anyone knows the reason?

Upvotes: 1

Views: 20003

Answers (2)

Time  Attendance System
Time Attendance System

Reputation: 319

if you try to create the linked server using studio and the various menus, a small detail is not saved in the connection string, which is the database! (see last bit of the connection string)

EXEC master.dbo.sp_addlinkedserver @server='MYSQL',
   @srvproduct='MySQL',
       @provider='MSDASQL', @provstr='DRIVER={MySQL ODBC 5.1
       Driver};SERVER=HOST;Port=3306;USER=uid;PASSWORD=pw;OPTION=3;DATABASE=mydb';

Upvotes: 0

Michael D
Michael D

Reputation: 111

I had the same problem, but it only occurs when my computer is not on-line (for example when working on an airplane). I just change the word 'localhost' to 127.0.0.1 and it seems to be working even when off-line. I hope.

Upvotes: 11

Related Questions