문제

Using Robotframework 2.6.3 and the python database library, I want to connect to MySql Database.

I have downloaded the DatabaseLibrary and MySQLdb however when I try to connect using:

Library DatabaseLibrary

DatabaseLibrary.Connect To Database MySQLdb cts1    root    password  172.16.7.20

I get the following error, when I run this using pybot:

OperationalError: (2003, "Can't connect to MySQL server on '172.16.7.20' (10061)")

Note: cts1 - is the DB name and 172.16.7.20 - is the IP address of DB.

This works when I use mysql under the command prompt. Why would it not be able to connect?

도움이 되었습니까?

해결책

The issue was I did not provide any PORT into robotframework and it does not correctly use the default port of 3306. Once I put the port in, it worked.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top