简体   繁体   English

当我尝试连接到我的数据库 nodejs 时,我收到一个未知的数据库错误

[英]Im getting a unknown database error when i try to connect to my database nodejs

im creating a chrome extension and i keep getting this error我正在创建一个 chrome 扩展程序,但我不断收到此错误

  code: 'ER_BAD_DB_ERROR',
  errno: 1049,
  sqlState: '42000',
  sqlMessage: "Unknown database 'blinkyblinky'",
  sql: undefined

below is the code I'm using下面是我正在使用的代码

const mysql = require('mysql2');

const connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    port: 3306,
    database: 'blinkyblinky'
});

connection.query('SELECT * FROM userdata',
    function(err, results, fields) {
        console.log(err);
        console.log(results);
        console.log(fields);
    }
);

this is the database I'm trying to connect to这是我试图连接的数据库这是我试图连接的数据库

添加密码参数作为密码:'',然后尝试

所以我检查了很多东西,我什至创建了一个数据库和一个表,并使用 javascript 将值插入其中,它起作用了,但是当我检查 locahost phpmyadmin 时,我创建的数据库都没有在那里,我就像地狱一样,所以当我仔细检查时显然它一直在我的 mysql 工作台中创建😂😂😂

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的服务器已启动,但是当我尝试连接它时,出现错误[Node.js] - My Server is up but when I try to connect to it I am getting an error [Node.js] 我收到:尝试将表单连接到数据库时,firebase.database不是函数错误 - I receive: firebase.database is not a function error when trying to connect my form to the database 当我尝试在Heroku上使用PGSQL更新数据库时,出现22001错误 - When I try to update my database with PGSQL on Heroku, I get a 22001 error 当我尝试测试运行我的 MySQL 数据库时收到此错误消息 - I get this error message when I try to test run my MySQL database 当我尝试使用 emailjs 时出现 thsi 错误:Uncaught ReferenceError: sendMail is not defined emailjs - im getting thsi error when i try to use emailjs: Uncaught ReferenceError: sendMail is not defined emailjs UnhandledPromiseRejectionWarning:错误:当我尝试运行我的代码时找不到模块“../database/db” - UnhandledPromiseRejectionWarning: Error: Cannot find module '../database/db' when i try to run my code 无法连接到nodejs中的数据库? - unable to connect to database in nodejs? 得到以下TypeError错误,当我尝试使用Node.js请求模块传递标头信息时 - Getting following TypeError error, When I try to pass the header information using nodejs request module 我的捕获错误,我似乎无法弄清楚 - Im getting an error with my catch that i cant seem to figure out 我试图导航到我的发货页面,但我一直收到此错误 - Im trying to navigate to my shipping page but i keep getting this error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM