2

I am trying to connect Google App Maker to MySQL database on digital ocean. Life of me I can't get going, I went through every possible forums and article.

Initially, I had a droplet with MySQL with SSL setup, then I configured another server with a simple setup, with no firewalls, no SSL. Still, I am getting this error.

Error: Failed to establish a database connection. Check connection string, username, and password.

Stak Trace from Google App Maker

Fri Aug 03 22:57:41 GMT+1000 2018 Error: Failed to establish a database connection. Check connection string, username and password. at connectDB (dbConnection:85) at datasources.employee.script:1

Fri Aug 03 22:57:41 GMT+1000 2018 Executing query for datasource employee: (Error) : Failed to establish a database connection. Check connection string, username and password. at connectDB (dbConnection:85) at datasources.employee.script:1

Fri Aug 03 22:57:41 GMT+1000 2018 Executing query for datasource employee failed.

I have set up the MySQL to listen to 0.0.0.0 (any interface), then the MySQL user to connect remotely with any ip '%'

 host      | user           | plugin                |
 +---------+----------------+-----------------------+
 | %       | user           | mysql_native_password |

Here is my db connection string

var conn = Jdbc.getConnection('jdbc:mysql://xxx.xxxx.xxxx.xxxx:3306/example','user', 'password');
  1. i can remotely connect to the db using mysqlworkbench
  2. i can connect using my local PHP setup using xampp.
  3. I can connect from another remote ubantu box using mysql.

So I have isolated that there is no issue in connecting to db remotely.

Am I missing something that I need to setup in App App Maker? I tried same connection on google appscript using google sheets, still didn't work.

I tried all possible methods of troubleshooting by isolating each possibility I am still unsuccessful for last two weeks. If anyone can help or direct me where I am going wrong will be much appreciated.

Thanks

  • Exactly what connection details do you use when connecting from MySQL Workbench and PHP? – Mark Rotteveel Aug 03 '18 at 11:56
  • php connection code ` DEFINE('DB_USERNAME', 'appuser'); DEFINE('DB_PASSWORD', '*****'); DEFINE('DB_HOST', '206.**.**.48'); DEFINE('DB_DATABASE', 'example'); $mysqli = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE); if (mysqli_connect_error()) { die('Connect Error ('.mysqli_connect_errno().') '.mysqli_connect_error()); } ' Also I tried the JDBC connection as well but i dont have the code now which i overwritten with above, For mySQL workbench used connection method: standard TCP/IP, hostname: 206.**.**.48, port: 3306, username:appuser, default schema: example – Sisil Lankage Aug 03 '18 at 12:51
  • Can you post the full exception stack trace? – Mark Rotteveel Aug 03 '18 at 12:53
  • E Fri Aug 03 22:57:41 GMT+1000 2018 Error: Failed to establish a database connection. Check connection string, username and password. at connectDB (dbConnection:85) at datasources.employee.script:1 E Fri Aug 03 22:57:41 GMT+1000 2018 Executing query for datasource employee: (Error) : Failed to establish a database connection. Check connection string, username and password. at connectDB (dbConnection:85) at datasources.employee.script:1 E Fri Aug 03 22:57:41 GMT+1000 2018 Executing query for datasource employee failed. – Sisil Lankage Aug 03 '18 at 12:58
  • Please **edit** your question with additional information, don't use comments, and it looks like this is not a MySQL error. – Mark Rotteveel Aug 03 '18 at 13:02
  • thanks mark, i have update the question – Sisil Lankage Aug 03 '18 at 13:14

0 Answers0