Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. let con = mysql.createPool({
  2. connectionLimit: 10,
  3. host: "157.245.50.123",
  4. user: "Admin-Zotova",
  5. password: "Zotova123$%^",
  6. database: "block_explorer"
  7. });
  8. con.getConnection((err, connection) => {
  9. if (err) {
  10. if (err.code === 'PROTOCOL_CONNECTION_LOST') {
  11. console.error('Database connection was closed.')
  12. }
  13. if (err.code === 'ER_CON_COUNT_ERROR') {
  14. console.error('Database has too many connections.')
  15. }
  16. if (err.code === 'ECONNREFUSED') {
  17. console.error('Database connection was refused.')
  18. }
  19. }
  20. if (connection) connection.release();
  21.  
  22. });
  23.  
  24. module.exports = con;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement