Skip to content
Advertisement

Tag: mysql

nodejs MySQL – Server requests authentication using unknown plugin

When attempting to connect to MySQL 8.0.21 server running Ubuntu 20.04 using NodeJS and mysql2 package, I receive the common error below: Server requests authentication using unknown plugin sha256_password I know that mysqljs and mysql2 do not support sha256, so I confirmed my user was setup for mysql_native_password: And have confirmed that default_authentication_plugin is set as mysql_native_password. What makes this

Gettting an undefined value from bcrypt hash function

Ok, I’m getting an undefined value from a function, I don’t know why, I’m trying to get the value of a password hash for insert in the database, but the const that have the function has the value “undefined”, so what I should change in my code? Answer When you call bcrypt.hash() and pass in a callback function, no Promise

Query not working with SQL Template Strings npm

I’m trying to use the sql template strings npm package to use template literals in my SQL queries securely, but I keep getting an error that states that there is a problem with the sql syntax. When I omit the “SQL” bit, everything works. I’ve installed the sql-template-strings package. What am I missing? Help appreciated! Error I get: You have

Looping an SQL statement on razor

Attempted to create a ‘cart’ which holds selected items by the user but upon form completion, all the data from the ‘cart’ is inserted into one row Example: How do I separate the data into a row each? Intended Result: How it works: The user will click a button that will generate the following HTML codes. (Javascript) The input named

Advertisement