Problem with mysql and discord.js

Hello guys, recently I've encoutered a problem that whenver that I try to start my bot using a sql database it wont let me and say that "access denied", now I've personally checked it alot of tiems and I saw the user name , host, password, db name are all correct and the database is imported. This is the error:
Error executing startrun
Error: Access denied for user 'botuser'@'localhost' (using password: YES)
at PromisePool.execute (C:\Users\user\Documents\GitHub\sleepy-bot\node_modules\mysql2\lib\promise\pool.js:54:22)
at Object.execute (C:\Users\user\Documents\GitHub\sleepy-bot\commands\startrun.js:90:39)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.execute (C:\Users\user\Documents\GitHub\sleepy-bot\events\interactionCreate.js:36:17) {
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sql: undefined,
sqlState: '28000',
sqlMessage: "Access denied for user 'botuser'@'localhost' (using password: YES)"
}
Error executing startrun
Error: Access denied for user 'botuser'@'localhost' (using password: YES)
at PromisePool.execute (C:\Users\user\Documents\GitHub\sleepy-bot\node_modules\mysql2\lib\promise\pool.js:54:22)
at Object.execute (C:\Users\user\Documents\GitHub\sleepy-bot\commands\startrun.js:90:39)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.execute (C:\Users\user\Documents\GitHub\sleepy-bot\events\interactionCreate.js:36:17) {
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sql: undefined,
sqlState: '28000',
sqlMessage: "Access denied for user 'botuser'@'localhost' (using password: YES)"
}
I do not know what to do - and I've tried to google + use chatgpt multiple times, he just repeats his solutions and they never work out for me, please help me. Thank you for all of the help 🙏
1 Reply
d.js toolkit
d.js toolkit3w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!

Did you find this page helpful?