Auth0 Home Blog Docs

Custome Database Issue



I am new to the auth0, trying to connect to the custom database using MYSQL I used the script which is generated by auth0 and changed the credentials in it and when am trying to connect it is showing connect ETIMEDOUT and i did enabled the import users to auth0 ,can anyone help me on this


Did you whitelist your MYSQL to be accessible from auth0 IPs?

Heads up! If you are trying to access a service behind a firewall, make sure to open the right ports and allow inbound connections from these IP addresses:,,,,,,


Thanks for responding. No, but I am trying to whitelist now this is what I have and I am still getting timed out.


Have you verified that on your MySQL database side you have whitelisted our IPs along with opened the right ports?


so you are talking about the ports where MYSQL is running?, I have one port open right now that is 3306 I am using XAMPP and phpmyadmin .


this is my script and i whitelisted the ipaddress.

function getByEmail(email, callback) {
  const mysql = require('mysql');

  const connection = mysql.createConnection({
    host: '********',
    user: 'root',
    password: '*******',
    database: 'icsocial'


  const query = 'SELECT id, email FROM users WHERE email = ?';

  connection.query(query, [ email ], function(err, results) {
    if (err || results.length === 0) return callback(err || null);

    const user = results[0];
    callback(null, {


Hey there @sravya,

You can explicitly declare your port in the Auth0 database scripts by passing an additional port attribute to the mysql constructor as shown below.

  host     : '',
  user     : 'user',
  password : 'pass',
  database : 'mydb',
  port: 3306

When you get a moment can you try this and let us know if it helps with the ETIMEDOUT error? Thanks!


Hi @James.Morrison thank you for responding. I tried that, it gave me the same error


I see you have a open support ticket that you are currently working with our support team to get to the bottom of this. To concentrate efforts i’ll have our support team take point on this front.

For historically thread context sake I will link the standard custom database documentation below and once a resolution from the ticket has been surfaced I will share that as well. Please let me know if you have any additional questions. Thanks!


ok thank you so much


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.