Category "mysql"

Error with creating a laravel foreign key

I'm trying to create a relational database and this is the error i get SQLSTATE[HY000]: General error: 1005 Can't create table somedumbtable.meals (errno: 150

get the most common value for each column

I'm attempting to create an SQL query that retrieves the total_cost for every row in a table. Alongside that, I also need to collect the most dominant value for

returning the LINESTRING of the part of a POLYGON that falls within another POLYGON?

I can see if two POLYGON's intersect with one another using MBRIntersects(g1, g2) but is there a way to return the LINESTRING part of g1 that falls within g2? A

live goelocalization of objects within a limited area with an existing data

I want to present and visualize multiple objects (with their height represented in cylinders, their directions, and other characteristics ) in a limited area o

Check if a number is prime or not in mysql

I am wondering what's the best way to check whether a number is prime or not using sql. I was able to generate the sequence of numbers from 1 to 1000 but I woul

Errors when connecting to MySQL local database

So, I have my local database, set it up, ran it from the windows services window. I open MySQL Workbench, and try to connect to the server. Hostname is localho

const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes) - TypeError: require(...) is not a function

I am beginner in web dev and trying to create a project using Mysql, Node.js with Express. Facing this TypeError issue while using Sequalize. Can someone please

How do I convert (node js) sequential processing of AWS log stream to mysql local db to parallel processing, without Error: Pool is closed. message?

The node js code operates as follows; fnGetLogEvents() calls AWS GetLogEventsCommand to get the events of the log stream putCloudwatchLog is called to convert e

MySQL upgrade causing unexpected results on simple WHERE clauses

I'm upgrading my Laravel app to use MySQL 8.0.23 from 8.0.20, and I see an issue with WHERE clauses that produce unexpected results. SELECT * FROM guilds W

What will the best solution for this multiple optional filter?

These are all optional fields, so will I have to write multiple queries with conditions or is there any way to handle this using Laravel? What will be the query

Select records and group each time column changes

I have this (MySQL) database, sorted by increasing timestamp: Timestamp RateSingle RateDouble RoomId 2022-01-01 100 150 1

Fill Random data into Mysql Table with date and time

I need help to fill random_data (between 0.750 to 0.775) for particular member_id with date and time stamp with 15 min increment start from particular date, Let

Unknown initial character set index '255' received from server

During attempt to create HibernateSession application fails with exception: Caused by: java.sql.SQLException: Unknown initial character set index '255' re

Hibernate doesn't create tables automatically

I have Maven project with Hibernate/Spring/MySQL. I have basic entity and I want Hibernate to create tables automatically, but Hibernate doesn't create any tabl

Docker ufw connect to host machine

I tried out Docker with UFW and i read a lot of this. My goal was to connect to an mariadb database on the host machine from an docker image. Host (running u

Why kafka write null data to the database?

I am working on a nestjs project. My project gets data from Kafka's topic and writes the data to the database (mysql). If I read hundreds of messages from Kafka

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

my connection: $con = new mysqli('localhost', 'root', '', 'test'); it does not work with that either: $con = new mysqli('localhost', 'root', '', 'test'

How to protect PDF files from being downloaded or copied

I'm developing a new website with PHP & MySQL. The website is for an online eBook library that grant access to its books based on paid subscription plans.

MySQL insert at random position

I want to build a poll where the answers are not assignable to the voters. But I need to keep track of who already voted. So I have two different MySQL tables,

Laravel mongodb where array field contains value

I use mongodb and mysql together with Laravel. Fields table in mysql database can have more options in mysql database. fields table in mysql: id, name options