QSqlQuery::prepare: database not open
-
I tried it on another server and it gives the following error..
QSqlError("2005", "QMYSQL: Unable to connect", "Unknown MySQL server host 'mysql.hostinger.fr' (0)") QSqlQuery::prepare: database not open
@RekTek249
Again: are you sure you are allowed to establish a remote connection to the database?- check user permission
- check if port is correct
- check if port is reachable from remote
-
@RekTek249 said in QSqlQuery::prepare: database not open:
It can.... What is the "2003" and 10060 meaning ? is 2003 the port ?
2003 is not a port name, so let's say the title of the problem.
-
@RekTek249 said in QSqlQuery::prepare: database not open:
It can.... What is the "2003" and 10060 meaning ? is 2003 the port ?
2003 is not a port name, so let's say the title of the problem.
-
To add to @the_ : the error state that
mysql.hostinger.fr
is an unknown host. Looks like you are giving the wrong address. -
@SGaist When I go to the "remote mysql" part of the site, it gives an access host... do i gotta use this as the hostname ?
@RekTek249 If that's what i do, it gives that error:
QSqlError("1045", "QMYSQL: Unable to connect", "Access denied for user 'rektek_write'@'*ip here*.' (using password: YES)")
If it's a permission problem, what do I need to do ? I have the insert one because that's the only thing I need to do...
-
Is this user authorised to access the database from outside that machine ?
-
That I don't know, you should ask them.
-
Then implement a REST service to expose what you need for your application.
What exactly are you trying to implement ? Because currently it seems you are trying to do server-side stuff from your application.
-
Then implement a REST service to expose what you need for your application.
What exactly are you trying to implement ? Because currently it seems you are trying to do server-side stuff from your application.
-
-
@RekTek249 Yes, you should implement a REST interface - exposing a SQL database to the public internet isn't a good idea.
-
To add to @the_, the tutorial explains thing nicely but there are more lightweight options than a full Java + eclipse + tomcat setup to get started.
Python wise there's the Django REST framework or Flask RESTful
PHP wise there's PHP Slim
There are also other options but you'd have to first share what you have available on your server.