Question: This code works fine:

```
import  MySQLdb

db = MySQLdb.connect("localhost", "root", "","bullsorbit")
cursor = db.cursor()

cursor.execute("Select * from  table  where  conditions'")
numrows = int(cursor.rowcount)

print 'Total number of Pages :  %d ' % numrows

```

but if I give my IP address 

```
db = MySQLdb.connect("192.168.*.*", "root", "","bullsorbit")

```

it will give this error

```
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on 'ip address' (111)")

```

Answer: 
Code 2003 is a [standard MySQL client error](http://dev.mysql.com/doc/refman/5.1/en/error-messages-client.html):

> 
> Error: 2003 (CR\_CONN\_HOST\_ERROR) Message: Can't connect to MySQL server on '%s' (%d)
> 
> 
> 

I'd guess that your user is not allowed to connect to the MySQL server using an iP-address. What happens if you try a connection usign the MySQL commandline client?

> 
> $ mysql --host=192.168.1.1 -u root bullsorbit
> 
> 
>
with localhost you connect via loopback-interface.

with ip-addr you connect - as you connect from extern.

if your server allows only the local (loopback) connection
your ip-addr connection fails. (security!)

look at your mysql config, maybe only local-connections are allowed.

is the skip-networking switch off (in the mysql-conf) ?

```
#skip-networking

```