Search Posts

Month: March 2018

Unable to connect to my database image after changing credentials

how to – Unable to connect to my database image after changing credentials I recently finished to build a small Laravel website that has a database, so I created an image of it through docker-compose, and attached a mariadb image to it and provided some credentials. Here is my docker-compose.yml file: version: ‘3’ services: web: build: . env_file: – .env.docker depends_on: – db ports: – ’80:80′ db: image: mariadb:latest restart: always env_file: – .env.mysql environment: […]

How to get the previous node for a sequence in a MariaDB OQGRAPH query?

how to – How to get the previous node for a sequence in a MariaDB OQGRAPH query? This question is based on the OQGRAPH MariaDB implementation: https://mariadb.com/kb/en/library/oqgraph-examples Example data: origid destid 1 2 2 3 2 6 3 4 4 5 5 6 When querying the shortest path to any node, I get the depth of the connections as “weight”. SELECT * FROM oq_graph g WHERE g.latch=’dijkstras’ AND g.origid=1; latch origid destid weight seq linkid […]

CURRENT_TIMESTAMP applied after waiting for lock – what is the value?

how to – CURRENT_TIMESTAMP applied after waiting for lock – what is the value? In a scenario where an InnoDB insert/update statement must wait for a transaction to complete, what is the value used for NOW() and/or CURRENT_TIMESTAMP? Is it the value from when the data was ready to be inserted/updated but started waiting for the lock to be released, or from when the changes were actually applied? I can’t find anything explaining this in […]

I just took an exam and couldn’t figure out how to write this select statement. Anyone able to point me in the right direction? I don’t need explicit lines, but a general idea of the function(s) would be greatly appreciated.

how to – I just took an exam and couldn’t figure out how to write this select statement. Anyone able to point me in the right direction? I don’t need explicit lines, but a general idea of the function(s) would be greatly appreciated. submitted by /u/danflo28 [link] [comments] Source: Rss Redit

Order by showing bad results in MariaDB

how to – Order by showing bad results in MariaDB In my query, I need to get the previous row with the current row and then join a few tables. I got the previous row by using SQL variables in my development server(MySQL 5.7), everything works fine, but in my production(MariaDB 10) server that previous row results are bad just mixed, bad part is only that previous row with SQL variables other query parts works […]

MySQL While Loop to fillup Table with incremental values where Auto-Increment is no option

how to – MySQL While Loop to fillup Table with incremental values where Auto-Increment is no option My attempt to fill a MySQL Table with at the moment incremental values. Later on there could be changes why AUTO-INCREMENT is no solution here. I’m working in the SWL console of phpMyAdmin Only the settingsOperationMixerId is AUTO-INCREMENT enabled I tried to do a loop: DELIMITER ; CREATE PROCEDURE fill() BEGIN DECLARE v1 INT DEFAULT 1; DECLARE b […]

Can’t unlock table in MariaDB 10.2

how to – Can’t unlock table in MariaDB 10.2 I’m using MariaDB 10.2. I have a table that has ~60M rows. Originally was I was trying to run: insert into signals select * from signals_tmp where signal_num = 21; And MariaDB froze. Since then I tried to restart mysqld and my laptop so I don’t have the exact state of when it first froze. Now when I tried to do this: select count(*) from signals […]

offset and limit syntax error

how to – offset and limit syntax error What is wrong here phpMyAdmin update posts set pos = ‘right’ where pos = ‘below’ limit 4 offset 10; I also tried: update posts set pos = ‘right’ where pos = ‘below’ offset 10 limit 4; update posts set pos = ‘right’ limit 4 offset 10; update posts set pos = ‘right’ offset 10 limit 4; Always the same error: #1064 – You have an error in […]

Next Page »