I cannot connect to my database which is hosted on OVH remotely from Flutter's package mysql1 and get the following error:
flutter: SocketException: Failed host lookup: 'saintlouqpweb.mysql.db' (OS Error: nodename nor servname provided, or not known, errno = 8)
I usually access it through phpMyAdmin where I have three fields to fill: the server, the user, and the password. I use exactly the same values than there with mysql1 on Flutter in addition to the database name (the server field of phpMyAdmin being the host field of mysql1).
I have searched for hours a solution but I still find nothing on this forum and on the web. Everything is always brought back to a 'localhost' server or a problem too different from mine.
Here is the piece of code causing the error :
Future> getData() async
{
try {
final conn = await MySqlConnection.connect(ConnectionSettings(
host: 'saintlouqpweb.mysql.db', // the exact server name entered on phpMyAdmin
user: 'myusername',
password: '*********',
db: 'mydatabasename',
));
var results = await conn.query(
'SELECT * FROM `mytable` WHERE ID=1;'
);
return results.toList();
} catch (e) {
print('$e');
}
}
I would be grateful if someone can help me about that or experienced the same issue previously.
CDN-old - Cannot connect to MySQL database from OVH server
Related questions
- You ip has been banned
3349
14.02.2021 14:57
- Regret coming to this website
2863
31.10.2018 00:36
- Can't change nameservers
2516
16.09.2020 08:58
- CDN Available soon?
2290
20.02.2018 13:38
- Install python libraries on ovh mutualized server
2270
27.07.2018 21:46
- Multisite NET::ERR_CERT_COMMON_NAME_INVALID error
1984
26.11.2020 08:45
- Web hosting project using angular js node js on server OVH interface client
1678
05.08.2021 10:42
- Set register MX to other provider
1535
14.05.2020 17:24
- View all the "sent emails"
1485
29.05.2020 13:35