Why data is not exported to Google spreadsheet?

Good afternoon. Please tell me what I did wrong or can do not look there?

Here is the article

Here attached to the article code:

// MySQL to Google Spreadsheet By Pradeep Bheron
// Support and contact at pradeepbheron.com
// If you like my content, please consider buying me a coffee. Thank you for your support! https://www.buymeacoffee.com/yoursupport


// Find the detailed tutorial with screenshots here: https://medium.com/@ipradeep/pull-and-sync-data-between-google-doc-spreadsheet-and-mysql-1d5a09d787a4
myMySQLFetchData function() { 

 var conn = Jdbc.getConnection('jdbc:mysql://127.0.0.1:3306/employee_db', 'username', 'pass'); // Change it as per your database credentials

 var stmt = conn.createStatement();
 var start = new Date(); // Get starting time script

 var rs = stmt.executeQuery('SELECT id,emp_name, emp_code FROM employee_details GROUP BY 1 LIMIT 1000'); // It sets the limit of the maximum nuber of rows in a ResultSet object

 // Find the detailed tutorial with screenshots here: https://medium.com/@ipradeep/pull-and-sync-data-between-google-doc-spreadsheet-and-mysql-1d5a09d787a4

 //change table name as per your database structure
 // If you like my content, please consider buying me a coffee. Thank you for your support! https://www.buymeacoffee.com/yoursupport 
 var doc = SpreadsheetApp.getActiveSpreadsheet(); // Returns the currently active spreadsheet
 var cell = doc.getRange('a1');
 var row = 0;
 var getCount = rs.getMetaData().getColumnCount(); // Mysql table column name count.

 for (var i = 0; i < getCount; i++){ 
 cell.offset(row, i).setValue(rs.getMetaData().getColumnName(i+1)); // Mysql table column name fetch and will be added in spreadsheet.
 } 

 var row = 1; 
 while (rs.next()) {
 for (var col = 0; col < rs.getMetaData().getColumnCount(); col++) { 
 cell.offset(row, col).setValue(rs.getString(col + 1)); // Mysql table column data will be fetch and added in spreadsheet.
}
row++;
}

rs.close();
stmt.close();
conn.close();
 var end = new Date(); // Get script ending time
 Logger.log('Time elapsed:' + (end.getTime() - start.getTime())); // To generate the script log. To view log click on View -> Logs.
}
// Find the detailed tutorial with screenshots here: https://medium.com/@ipradeep/pull-and-sync-data-between-google-doc-spreadsheet-and-mysql-1d5a09d787a4
// If you like my content, please consider buying me a coffee. Thank you for your support! https://www.buymeacoffee.com/yoursupport


Here is my code:

function myFunction() {
 // MySQL to Google Spreadsheet By Pradeep Bheron
// Support and contact at pradeepbheron.com
// If you like my content, please consider buying me a coffee. Thank you for your support! https://www.buymeacoffee.com/yoursupport


// Find the detailed tutorial with screenshots here: https://medium.com/@ipradeep/pull-and-sync-data-between-google-doc-spreadsheet-and-mysql-1d5a09d787a4
myMySQLFetchData function() { 

 var conn = Jdbc.getConnection('jdbc:mysql://127.0.0.1:3306/menu', 'root', "); // Change it as per your database credentials

 var stmt = conn.createStatement();
 var start = new Date(); // Get starting time script

 var rs = stmt.executeQuery('SELECT * FROM quests'); // It sets the limit of the maximum nuber of rows in a ResultSet object

 // Find the detailed tutorial with screenshots here: https://medium.com/@ipradeep/pull-and-sync-data-between-google-doc-spreadsheet-and-mysql-1d5a09d787a4

 //change table name as per your database structure
 // If you like my content, please consider buying me a coffee. Thank you for your support! https://www.buymeacoffee.com/yoursupport 
 var doc = SpreadsheetApp.getActiveSpreadsheet(); // Returns the currently active spreadsheet
 var cell = doc.getRange('a1');
 var row = 0;
 var getCount = rs.getMetaData().getColumnCount(); // Mysql table column name count.

 for (var i = 0; i < getCount; i++){ 
 cell.offset(row, i).setValue(rs.getMetaData().getColumnName(i+1)); // Mysql table column name fetch and will be added in spreadsheet.
 } 

 var row = 1; 
 while (rs.next()) {
 for (var col = 0; col < rs.getMetaData().getColumnCount(); col++) { 
 cell.offset(row, col).setValue(rs.getString(col + 1)); // Mysql table column data will be fetch and added in spreadsheet.
}
row++;
}

rs.close();
stmt.close();
conn.close();
 var end = new Date(); // Get script ending time
 Logger.log('Time elapsed:' + (end.getTime() - start.getTime())); // To generate the script log. To view log click on View -> Logs.
}
// Find the detailed tutorial with screenshots here: https://medium.com/@ipradeep/pull-and-sync-data-between-google-doc-spreadsheet-and-mysql-1d5a09d787a4
// If you like my content, please consider buying me a coffee. Thank you for your support! https://www.buymeacoffee.com/yoursupport
}


In the table there is nothing :/

5e11f63198f08560645207.png

PS: Error when you debug does not arise when running too
April 4th 20 at 00:51
1 answer
April 4th 20 at 00:53
Try this option
So like it and tried) - jamel.Roberts3 commented on April 4th 20 at 00:56
@jamel.Roberts3, you have the database on an external IP? There it was discussed - Natali commented on April 4th 20 at 00:59
@Natali, tried and external, now I have a connection error

5e121d2fc8ac3290693545.png - jamel.Roberts3 commented on April 4th 20 at 01:02
@jamel.Roberts3, so you have the 127.0.0.1 is a General localhost. And you need an external IP, which the Internet can reach. For example to you I was able to access the database, knowing username and password - Natali commented on April 4th 20 at 01:05
@Natali, I'm gonna try to host porubitsya - jamel.Roberts3 commented on April 4th 20 at 01:08
@Natali, bespaltno, took ssh ip / log,par,database mysql not working.. - jamel.Roberts3 commented on April 4th 20 at 01:11
@jamel.Roberts3, tried domain, also to no avail.. - jamel.Roberts3 commented on April 4th 20 at 01:14

Find more questions by tags JavaScriptGoogle Sheets