I'm trying to get a node.js app that uses mysql to work. I run sudo node app.js and I get this error:
Express server listening on port 80 in development mode
events.js:48
throw arguments[1]; // Unhandled 'error' event
^
Error: Access denied for user 'root'@'localhost' (using password: YES)
at cmd.process_packet (/Users/.../Documents/Code/.../node_modules/mysql-native/lib/mysql-native/command.js:35:15)
at SocketClient.dispatch_packet (/Users/.../Documents/Code/.../node_modules/mysql-native/lib/mysql-native/socketclient.js:105:32)
at Socket.<anonymous> (/Users/.../Documents/Code/.../node_modules/mysql-native/lib/mysql-native/socketclient.js:59:18)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:362:31)
I set up a secure user and password for mysql but it's not asking me for a password besides one for sudo. I'm a beginner with both node.js and especially mysql so any help would be appreciated.
root?rootis the superuser account, with uid0. Are you running asrootwhen you start the application?