-1

Kind Request before marking it as duplicate read full question.

Error :- 'Access denied for user 'Test_UG'@'88.81.84.184' (using password: YES)', code: 'ER_ACCESS_DENIED_ERROR', errno: 1045, sqlState: '28000', stack: 'Error: Access denied for user 'Test_UG'@'88.…Trampoline (node:internal/async_hooks:130:17)'

Software/Application/Program used for – Visual Code, Node.js, PHP, MySQL

Hosting Used – Go daddy, Cpanel

Purpose of Program – Making Telegram Bot, MySQL being used for storing data

Was it working on Local Machine ? – Yes it was working on local machine using Wamp Server.

Change made – only changed MySQL connection details

Solution tried – Tested with full access new DB, User & Password, also tested with old user which is created 2-3 days ago. Tried many solutions from stack overflow few of them are below

MySQL: Access denied for user 'test'@'localhost' (using password: YES) except root user

Access denied for user 'test'@'ip'(using password: YES)

Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?

Node.js code –

// Create a MySQL pool
const dbConnect =({
    host: 'xyz.com',
    user: 'Test_UG',
    password: 'Xyz@1122!',
    database: 'xyz_bot',
  });

// Function to store user messages in the database
async function storeMsg(msg) {
   
    const connection = await mysql.createConnection(dbConnect);

    try {
        await connection.execute('INSERT INTO chat_details (username, user_id, msg_date, token_name, token_amount, msg) VALUES (?, ?, NOW(), ?, ?, ?)',
            [msg.from.username, msg.chat.id, getRandomToken(), getTokenAmount(0.001, 0.2), msg.text]);

        console.log('User message stored in the database.');
    } catch (error) {
        console.error('Database error:', error);
    } finally {
        connection.end();
    }
}
6
  • Can you connect to your database instance on Godaddy and run SHOW GRANTS FOR 'Test_UG'@'%' and confirm the user exists and has privilege to use database xyz_bot? Commented Nov 2, 2023 at 16:22
  • @BillKarwin - Yes all privilege are givien to user... i executed given command but giving below error #1044 - Access denied for user 'cpses_oi7as6pfov'@'localhost' to database 'mysql' Commented Nov 2, 2023 at 18:01
  • This seems like a technical support call to Godaddy is required. Commented Nov 2, 2023 at 18:37
  • @BillKarwin do you know how to flush on Godaddy ? Commented Nov 2, 2023 at 18:48
  • I have never used Godaddy, but I do know it's not necessary to FLUSH PRIVILEGES after using CREATE USER or GRANT. You only need to flush privileges if you use INSERT/UPDATE/DELETE directly on system tables. But it seems you don't have privilege to do that anyway, so I assume you don't need to flush privileges. Commented Nov 2, 2023 at 18:52

1 Answer 1

1

I connected with Go Daddy technical support team they gave below solution...

Go to --> CPannel --> Database --> Remote MySQL

enter image description here

Input your IP address/localhost address in my case it is 88.81.84.184 and click on Add Host.

enter image description here

It take 5 to 90 min update.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.