I created a MYSQL database in AWS RDS, and this is the config settings setup:
DB instance ID
database-1
Engine version
8.0.28
DB name
-
so as you can see, there isn't a db name. So now, when I go to create a table via my code, or even mysql workbench, since no db name is included, it fails with:
Database connection failed: Error: ER_BAD_DB_ERROR: Unknown database 'database-1'
I am trying this in code as well:
var mysqlconn = mysql.createConnection({
host: 'database-1.xxx.com,
user: 'username',
password: 'pw,
port: '3306',
database: 'database-1'
});
let createTable = "CREATE TABLE table_name (name VARCHAR(256),email VARCHAR(256),number INT(32))"
but it gives the above error. any advice / help is much appreciated
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.