FAQ Database Discussion Community


golang editing previously set flag. MySQL error 1045

mysql,go,localhost,mysql-error-1045
I'm having trouble setting a flag after user input to use as a connection parameter to a MySQL Database. Below is a snippet of my code: func init() { flag.StringVar(&flagUser, "user", "root", "User") reader := bufio.NewReader(os.Stdin) fmt.Print("Enter username: ") inputUser, _ := reader.ReadString('\n') f := flag.Lookup("user") if inputUser != f.Value.String()...

Mysql and NodeJS can't connect remotely to deployed app

mysql,node.js,cpanel,remote-access,mysql-error-1045
I am trying to connect from a NodeJS app to a MySQL database (already deployed, not in a localhost), currently it throws an error saying: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'187.189.130.120' (using password: YES) at Handshake.Sequence._packetToError (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\sequences\Sequence.js:48:14) at Handshake.ErrorPacket (C:\wamp\Respaldo Linux\Documentos\WebDev\misGastosApp\node_modules\mysql\lib\protocol\sequences\Handshake.js:101:18) at...