mysql

AWS EB undefined RDS_HOSTNAME with Database hosts array empty

懵懂的女人 提交于 2021-02-11 14:35:34
问题 Currently in a Laravel project using AWS EB with RDS. When I run php artisan migrate --seed then I get PHP Notice: Undefined index: RDS_HOSTNAME in /var/app/current/config/database.php on line 5 PHP Notice: Undefined index: RDS_USERNAME in /var/app/current/config/database.php on line 6 PHP Notice: Undefined index: RDS_PASSWORD in /var/app/current/config/database.php on line 7 PHP Notice: Undefined index: RDS_DB_NAME in /var/app/current/config/database.php on line 8 and Database hosts array is

Mysql average value every minute refer to unix timestamp

做~自己de王妃 提交于 2021-02-11 14:28:03
问题 I logging my temperature every 1-3 seconds with unix timestamp, I wish like get row of data return by average every 1 minute period and last for 24 hour. my logger table look like this: unixtime temp 1350899052 25.37 1350899054 25.44 1350899057 25.44 1350899059 25.44 1350899062 25.44 1350899064 25.44 1350899069 25.44 1350899071 25.44 and i wish like it return as unixtime temp 1350899052 25.37 -- average value of 1 minute range both unixtime and temp 1350899054 25.44 1350899057 25.44 please

How do I import CSV file into a MySQL table?

你离开我真会死。 提交于 2021-02-11 14:25:22
问题 I have an unnormalized events-diary CSV from a client that I'm trying to load into a MySQL table so that I can refactor into a sane format. I created a table called 'CSVImport' that has one field for every column of the CSV file. The CSV contains 99 columns , so this was a hard enough task in itself: CREATE TABLE 'CSVImport' (id INT); ALTER TABLE CSVImport ADD COLUMN Title VARCHAR(256); ALTER TABLE CSVImport ADD COLUMN Company VARCHAR(256); ALTER TABLE CSVImport ADD COLUMN NumTickets VARCHAR

Issue concatenating rows with duplicates

十年热恋 提交于 2021-02-11 14:24:16
问题 I have run into some issues trying to combine a row of variables where dublicates can be found. Computers with Ids are saved in the Computer table: | Computer.Id | |-------------| | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 | | 9 | Harddrive are saved in a HardDisk table with a HardDisk Id exclusive to the harddrive and a ComputerId linked to the Id in the Computer table | Harddisk.ComputerId | Harddisk.Id | |---------------------|-------------| | 1 | 1 | | 2 | 2 | | 3 | 3 | | 4 | 4 | | 5 |

How to create an inverse ordered variable in my sql

江枫思渺然 提交于 2021-02-11 14:21:50
问题 I have a column with running sum, but I would like to inverse the order in a new or same column My Query is SELECT date, ant, num_room, (@csum:= @csum + num_room) as cumulative_room from xxx_xxxx_xxxx WHERE date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE() AND(select @csum := 0) = 0 order by date Mi table is date | ant | num_room | cumulative_room 28-04-2020 6 1 1 28-04-2020 3 1 2 28-04-2020 4 1 3 28-04-2020 7 1 4 28-04-2020 4 1 5 .... How I can do another variable with reverse order

MySQL with EntityFramework Core - Composite Foreign Key

China☆狼群 提交于 2021-02-11 14:19:30
问题 I have two tables Project and ProjectMedia . they are defined as follow: CREATE TABLE `project` ( `ID` int(11) NOT NULL, `LANG` char(2) NOT NULL, `NAME` varchar(64) CHARACTER SET utf8 DEFAULT NULL, `DESCS` varchar(2048) CHARACTER SET utf8 DEFAULT NULL, `SHORT_DESC` varchar(512) CHARACTER SET utf8 DEFAULT NULL, PRIMARY KEY (`ID`,`LANG`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ID and LANG are a composite primary key in the Project table. ProjectMedia table definition: CREATE TABLE `project

Select information from the database for a page accessed by different users

六月ゝ 毕业季﹏ 提交于 2021-02-11 14:17:55
问题 This is the scenario: User A: Access the website and choose a questionnaire. The questionnaires are separated on different pages in the same domain, for example: Home: "surveys.com" Questionnaires: "surveys.com/type1" "surveys.com/type2" After choosing one, he ( User A ) puts the following information: 1 = Recipient's email 2 = His email And then submit. User B: Person who received this link to the questionnaire (surveys.com/type1). What I want to do is: When User B accesses the link to the

Can't get LAST_INSERT_ID() to work from ASP classic

孤人 提交于 2021-02-11 14:17:40
问题 This question is driving me crazy and I hope you can help. I want to use the following sql for a MySQL-database: INSERT INTO Prenumeranter (Pren_Namn,Pren_Email) values ('Testing','test@test.com'); UPDATE Prenumeranter SET Pren_kod = encrypt(LAST_INSERT_ID()) WHERE Pren_id = LAST_INSERT_ID(); This code works perfect if I run it in PhpMyAdmin but if I run it on my asp classic page it only gives errors for the LAST_INSERT_ID(). I have tried to rewrite it in different ways, but they all work in

How to use JsonObject of Pomelo.EntityFramework

风流意气都作罢 提交于 2021-02-11 14:15:11
问题 I want to store list of string into mysql table as json. I saw there is support for this in pomelo entityframework. I followed this https://libraries.io/github/tuanbs/Pomelo.EntityFrameworkCore.MySql Here is my entity public class Project { public int Id {get;set;} public string Title {get;set;} public JsonObject<List<string>> Tags {get;set;} } But when _context.Database.EnsureDeleted(); is called it gives below error Navigation property 'Tags' on entity type 'Project' is not virtual.

Access MySQL server in private ec2 instance in nodejs

空扰寡人 提交于 2021-02-11 14:02:33
问题 I am new to AWS and Node js. I want to query a MySQL server in a private ec2 instance in a testing project which I am building using Node js. How should I go about it? Thanks EDIT: I want to access it through my local computer. The way I came up with was: Start a terminal from node js - don't know which method would be best Use the terminal to login into public ec2 connect to private ec2 through public instance launch the MySQL client through private instance and query it. I wanted to know if