Node JS and mysql not connecting (client does not support authentication protocol requested by server consider upgrading mysql client)

后端 未结 4 1332
再見小時候
再見小時候 2021-01-19 08:09

I\'m trying to connect my NodeJs application with a mysql database but its not connecting for some reason.

I did install the mysql npm like this (typed this in comma

4条回答
  •  爱一瞬间的悲伤
    2021-01-19 08:43

    I was having the same problem with mysql library and I fixed that error by changing to mysql2 Library I recommend you to install mysql2

    Run

    npm install mysql2
    

    Then

    import mysql from "mysql2";
    

    OR

    const mysql = require("mysql2")
    

    I hope this will work for you!! Good Luck

提交回复
热议问题