mysql

Connecting to Aurora MySQL Serverless with Node

假装没事ソ 提交于 2021-02-10 15:53:19
问题 I'm trying to connect to my Aurora Serverless MySQL DB cluster using the mysql module, but my connection always times out. const mysql = require('mysql'); //create connection const db = mysql.createConnection({ host : 'database endpoint', user : 'root', password : 'pass', database : 'testdb' }); //connect db.connect((err) => { if(err){ throw err; console.log('connection failed'); } console.log('mysql connected...'); }) db.end(); My cluster doesn't have a public IP address so I'm trying to use

Query MySQL Table with Excel VBA, ODBC Connection

旧巷老猫 提交于 2021-02-10 15:52:01
问题 I've got a bit of an issue with Microsoft Excel while trying to get values from an MySQL 8.0 Table. I have some code (below) I got from the net but I keep getting an error message. I'm quite new at this so I need a bit of help. I'm on Windows 10 with a 64 bit computer. Timeline: → I downloaded MySQL a week ago, got the 8.0 workbench version and have the connector installed (Connector/ODBC 8.0.12 - X64). → I created a Schema called sap in the MySQL Workbench → I created a Table in sap called

Mysql: Convert column from timestamp to int and perform conversion for each update

瘦欲@ 提交于 2021-02-10 15:50:11
问题 I have a existing database column of type timestamp that I need to modify to become an INT(11) , but in order for this to happen I need to convert each timestamp value as I change it. Here's my modify statement currently that won't correctly convert the timestamp: ALTER TABLE my_table MODIFY COLUMN updated_on INT(11) UNSIGNED NOT NULL; Is there a way to provide a conversion function or something to the alter command? Otherwise I was thinking I could Create a new column, called updated_on_temp

REVERSE of a number in mysql

旧时模样 提交于 2021-02-10 15:49:31
问题 used the following stored procedure to find reverse of a number , but it is showing error:use the right syntax to use near loop. DELIMITER // CREATE PROCEDURE ggrepeat1() begin declare num1 int; declare num2 int; declare rev int default 0; set @num1:='&num1'; while num1>0 loop set @num2:=num1 mod 10; set @rev:=num2+(rev*10); set @num1:=floor(num1/10); end loop; dbms_output.put_line('Reverse number is: '||rev); end// DELIMITER ; 回答1: The while loop in mysql should be used in this like. This is

Mysql: Convert column from timestamp to int and perform conversion for each update

时光怂恿深爱的人放手 提交于 2021-02-10 15:47:02
问题 I have a existing database column of type timestamp that I need to modify to become an INT(11) , but in order for this to happen I need to convert each timestamp value as I change it. Here's my modify statement currently that won't correctly convert the timestamp: ALTER TABLE my_table MODIFY COLUMN updated_on INT(11) UNSIGNED NOT NULL; Is there a way to provide a conversion function or something to the alter command? Otherwise I was thinking I could Create a new column, called updated_on_temp

Connect to MySQL container from Web Api .Net Core Container? How to get Ip Address?

∥☆過路亽.° 提交于 2021-02-10 15:30:38
问题 I know this is such a noob problem but I am having trouble understanding how to get my .Net Core website to connect to my MySql container. So some background, both the MySql and the .Net core website are in their separate containers. I have already started the MySql container and setup the root account to work. I am using Entity Framework inside of .Net Core project. I created the MySql container using this statement: docker run --name mysql_container -d -p 3306:3306 Below is the dockerfile

mysqldump fails with “Skipping dump data for table 'table1', it has no fields”

北战南征 提交于 2021-02-10 15:20:40
问题 I'm running mysqldump from an older mysql database. The mysqldump is part of a mariadb distribution if it matters. When I run mysqldump locally, it's fine. When I run it on a remote system, I get no data dumped. If I run it with mysqldump -v the last line is Skipping dump data for table 'table1', it has no fields 回答1: From some googling and this reddit thread, I determined that you need to set the default locale. So the command that worked for me was: mysqldump --default-character-set=latin1

Should I turn off Query Cache in MySQL?

核能气质少年 提交于 2021-02-10 15:12:59
问题 I'm using a dedicated server with 32GB RAM and an 8-core server, using Maria DB 10.1 and most tables are InnoDB. Total DB size is less than 2GB but I think performance is slow. The following is the my.cnf file I'm using: [mysqld] log-error=/home/MySQL_Server/mysql/dedi.server.co.err datadir=/home/MySQL_Server/mysql pid-file=/home/MySQL_Server/mysqlmysqld.pid innodb_file_per_table=1 skip-name-resolve=1 bind-address=127.0.0.1 #skip-networking=1 #query_cache_type=0 query_cache_type=1 innodb_file

Subquery returns more than 1 row - MySQL

馋奶兔 提交于 2021-02-10 15:10:42
问题 UPDATE `pams_faker_lead_location` SET `location` = ( SELECT location FROM pams_leads WHERE pams_leads.location_id = pams_faker_lead_location.id ) I dont know when i run the query in Mysql , this error occur. #1242 - Subquery returns more than 1 row anyone can help me solve the problem ? 回答1: This query: SELECT location FROM pams_leads WHERE pams_leads.location_id = pams_faker_lead_location.id gives you more than 1 row. You must change something because if you need update value you need

JHipster throws error from Hikari, liquibase, Springboot configuration

左心房为你撑大大i 提交于 2021-02-10 15:05:19
问题 after setting up Jhipster microservice with MySQL Database and run it for the first time in the Intellij terminal the: Hikari, liquibase, Springboot configuration, throws error with this log: ERROR 8353 --- [ restartedMain] com.zaxxer.hikari.pool.HikariPool : Hikari - Exception during pool initialization. ERROR 8353 --- [ restartedMain] i.g.j.c.liquibase.AsyncSpringLiquibase : Liquibase could not start correctly, your database is NOT read ERROR 8353 --- [ restartedMain] com.zaxxer.hikari.pool