Questions tagged [mysql]
MySQL is a free, open-source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). DO NOT USE this tag for other DBs such as SQL Server, SQLite etc. Those are different DBs that all use their own dialects of SQL to manage the data. Always specify the exact version of the server in the question. Note that configuration/setup-related questions are off-topic on stackoverflow.
mysql
661,942
questions
0
votes
0
answers
6
views
Find records as And in MYSQL
I want find Students id that , must have (professorId = 3 And courseId = 4) And (professorId = 3 And courseId = 2) And (professorId = 5 And courseId = 8).
sometime these parenthesis is one or more ...
0
votes
0
answers
23
views
SQL Inner join with where clause works fast with one condition, but not when activeFlag is added
I have a query like
select C.customerId, C.firstName, C.LastName, R.IsActive from
Customer as C
Inner join Rider as R ON R.customerId = C.customerid
where R.rideid = 'xyz' and
R.rideareacode = 'abc' ...
0
votes
2
answers
14
views
PHP variable from mysql query in form, when null
I have an html form used to edit a record in a mysql table.
In the case of editing, I prefill the form with the current values for the record as returned by the query, as below:
<INPUT TYPE="...
-1
votes
1
answer
26
views
laravel model pages not communicating properly
Working on a client project, hit a setback.
Laravel is reading
"Call to undefined relationship [service_item] on model [App\Models\Service]".
It's simply trying to read data from two ...
-2
votes
0
answers
19
views
Laravel 10 migration data type ( Exg : text, string, longtext ... Etc.) size list in charector and size(kb pr mb)
Laravel 10 migration data type (Exg: text string longtext etc.)
Data type
size KB (char)
String
xx kb (cab)
Text
xy kb (acb)
Can anyone share this list.
A list of data type and it's sizes ( ...
0
votes
0
answers
26
views
Python script gets stuck due to mysql query running for longer period
Mysql version - 5.7
Python version - 3.9.2
I have a dynamic mysql query, which sometimes runs for over 10 mins or something and the mysql's set timeout has been set to around 1 minute. Which is why i ...
0
votes
1
answer
20
views
How to merge multi schema data into single schema in mysql?
I have one application with multi-schema and single schema both running on differnt server.We use MySQL database with multiple schemas, each containing several tables, stored procedule and other ...
0
votes
0
answers
24
views
docker-compose generated WebAPI container fails to connect to MySql container
I have a Visual Studio .Net 8 Solution that contains a WebAPI backend project. It also contains dockerfile. I have also added a docker-compose to orchestrate the project. Outside of this visual ...
0
votes
0
answers
13
views
Unable to Export Data In Hindi (Unicode) Excel using PHP and MySqli
Unable to Export Data In Hindi (Unicode) Excel using PHP and MySqli
Below is the code im using to export data from the database & its working fine but when i try to export hindi entries excel ...
0
votes
2
answers
40
views
Select user's high score for each lesson from one table based upon lesson ids in another table
I have a site that has multiple courses and each course has multiple lessons. I would like to select the highest score per LESSON for a given user_id and course_id ordered by lesson_order.
TABLE ...
-2
votes
0
answers
21
views
insert in to target table and avoid the rows with same set of column value from source to target [duplicate]
-- Create a temporary table with sample data
CREATE TEMPORARY TABLE temp_student (
roll_no INT,
name VARCHAR(50)
);
-- Insert some sample records into the temporary table
INSERT INTO ...
0
votes
2
answers
26
views
Connecting to local mysql server from within a docker container [duplicate]
I'm running a go app locally (MacOS Sonoma) that connects to a local mysql server. This works fine when I build the app and run it from the command line. When I create a container and run it - all ...
0
votes
0
answers
38
views
How to Use a Single INSERT INTO Statement for Multiple Rows in Python?
I’m currently working on a Discord Python bot where I loop through a list of ForumTags and generate an INSERT INTO SQL statement for each object to insert data into a MySQL database.
However, I want ...
0
votes
0
answers
17
views
Flask-MySQL Python long request
I'm using Flask to create an API. I need to make a query to the database and for this I used the flask_mysqldb library
The fact is that before that I used another library (mysql.connector) and my ...
-1
votes
0
answers
29
views
MySQL Server 8.0.39.0 configuration fails at "Starting Server"
I was installing MySQL installer recent version 8.0.39.0 on my Win10 pc. During the server configuration process, it gets stuck at "starting server" and doesn't move any further.
enter image ...
0
votes
2
answers
46
views
MergingTwo SQL Queries Select and Count in Single statement
I am Working on project, where I am using two queries to get the result i wanted to process.
Query 1
SELECT MID FROM PMS.MACHINE WHERE STATUS=1 AND MID !=0;
Query 2
SELECT MID,COUNT(STATUS) AS QUEUE
...
0
votes
1
answer
39
views
Detecting OR operator sequences and wrapping their content in a parenthesis when building a query with PHP
I made the following PHP code to build a query based on user input, where they can choose the condition and the operator and the resulting query would be printed on their screen every time they added ...
1
vote
0
answers
31
views
How to calculate Running balance in RDLC reports?
I have an application that uses C#, Entity framework core & MySql database for tracking income & expense and i'm using RDLC for reporting.
I have a transactions table for tracking income and ...
0
votes
1
answer
29
views
MySQL: How to pull in values from 2 different tables in one row?
If I also want to pull form.form_name into my results on the same row, how would I adjust my query below? The form_id in the form table = the form_id in the form_version table. I also need to filter ...
-2
votes
0
answers
24
views
MacBook remote database access works with Sequel Ace and MySQL Workbench but not php (not a duplicate) [duplicate]
My remote database access works with Sequel Ace and MySQL
Workbench but not php
My connection script contains the exact same data.
I've searched everywhere for a solution.
Any idea why?
Thanks.
Robert
...
-7
votes
0
answers
34
views
How does JSON ensure conventions of relational database management systems, as it is denormalizes data? [closed]
MYSQL being a relational DBMS has support for JSON documents using the JSON data type.
According to Codd's rules for relational database management,
Every data dimension should be equivalent in its ...
0
votes
1
answer
33
views
Eloquent ORM performance with subqueries for relational models
Laravel eloquent uses subqueries for relationship model instead of joins as joins offer more optimal performance .How does eloquent orm ensures performance for relational models ?
1
vote
1
answer
25
views
Get JSON Parent object name in MySql 8
{
"hi": {
"blue_line_branch": {
"stations": {
"1_station_name": "यमुना बैंक",
"2_station_name": "लक्समी नगर&...
0
votes
1
answer
28
views
Laravel app getting "[1045] Access denied for user 'root'@'172.19.0.4'" error when connecting to MySQL Docker container
I'm facing an issue connecting my Laravel application to a MySQL Docker container. When I run php artisan migrate, I'm getting the following error:
SQLSTATE[HY000] [1045] Access denied for user 'root'...
3
votes
0
answers
60
views
Bottom-up tree structure cumulative sum
entityid
parentid
emission
E1
E2
541
E2
E4
272
E3
E4
270
E4
NULL
362
I have the above tree structure, my goal is to calculate the cumulative sum of each node, with weighted contribution from the ...
0
votes
2
answers
52
views
Sum values between a lot of date-ranges in a single column
I'm trying to figure out how to get a sum of value by transaction dates over a 90 day period and repeated over a single year's worth of transaction dates.
This is what I have
transaction_date
value
...
0
votes
0
answers
36
views
React Form Submission Logs Updated Data but Does Not Update Database or Navigate to Tasks Page
now i 'm creating endpoint for editing task for to do app using laravel and react.js
the end point i tested it using postman and it returns success response http://localhost:8000/api/tasks/4
and the ...
0
votes
0
answers
46
views
Problem with Spring Boot,mysql and Docker
I have a spring boot application that has a connection to the mysql database, when I try to dockerize it and create the image whenever the application image will run these logs
2024-07-24 17:45:44 ...
-1
votes
1
answer
25
views
Unable to set default on JSON column in mysql 8.0.31
I'm trying to set a default for a new JSON column in a mysql 8.0.31 db. As far as I am aware, this wasn't possible till version 8.0.13. Starting with version 8.0.13, it should be possible to set ...
0
votes
1
answer
17
views
php container unable to reach mysql within teamcity pipeline
I recently tried to migrate my pipelines to teamcity for a project but ran into issues with my pipelines within teamcity not being able to connect to my mysql container.
It's a hard requirement to use ...
-3
votes
0
answers
19
views
Data Import in mysql [closed]
i am facing this issue while facing this is importing CSV in Mysql
i have importing data from excel through import and tried to change the date format but it doesn't worked so any guidance would be ...
2
votes
2
answers
63
views
How can I set a numeric wildcard in MySQL? [duplicate]
I'm trying to create a SQL script that finds codes in two different databases. I want to set a parameter that has a numeric wildcard.
Codes are often written like this for example, ABC108, ABC109, ...
0
votes
1
answer
37
views
Unable to make a remote api call to flask app(for MySQL connection) inside my apache server
I have an apache server running on Alma Linux. I have the flask code setup to accept API calls from remote connections. So my API call hits the flask which then connects to MySQL database.
When I try ...
-1
votes
0
answers
30
views
Trying to connect a client OrangePi Zero to a remote my PC's remote server [closed]
I have a flask project which basically fetches state changes of 4 entries from a MySQL database in a MySQL server which runs locally and display them on the dashboard which also runs locally.
This ...
0
votes
0
answers
11
views
Error Unable to cast object of type 'System.Int32[]' to type 'System.IConvertible' when calling Stored Procedure in MySQL
The Error says that Unable to cast object of type 'system.byte[] ' to type 'System.IConvertible' in the ExcecuteNonQuery(). What should I do? Anyone....
Details: HeidiSQL, and MySQL 5.0.96
public ...
0
votes
1
answer
27
views
How to Handle Indexes for @MapsId in JPA: Should FK and PK Share the Same Index?
I am using the @MapsId annotation in JPA to map a foreign key (FK) to a primary key (PK). According to the @MapsId annotation, the FK and PK share the same value. However, when I checked the database ...
0
votes
0
answers
25
views
Unable to insert Mirth logs in MySql DB using log4j 2.17.2 JDBC appender
I'm using Mirth Connect, which uses log4j 2.17.2. I have tried to insert Mirth logs in a MySql DB using the log4j2 JDBC appender but failed to do so. Mirth Connect runs and logs to the dashboard and ...
-2
votes
0
answers
39
views
is there a way to store unschematised datas in sql database [closed]
mysql : 5.6 java : 11
Am in need of an mechanism to store unschematised data in my db. the case is as follows.
Objective :
To get all user from a 3rd party app and store it in db.
Problem facing :
...
0
votes
2
answers
34
views
Weighted hierarchical cumulative sum
I don't know if I'm using the correct terminology, but I'm trying to find the cumulative sum of each node in a tree structure, but the children node only contribute a percentage of its cumulative sum ...
0
votes
0
answers
25
views
Node zlib: throwing incorrect header check while inflating or unzipping
I have a varbinary type column jsonBin in db. I want to store json (string) which is compressed using zlib.
zlib.gzipSync(data) or zlib.deflateSync(data) returns buffer object.
If I use base64 ...
-3
votes
0
answers
18
views
MySQL data to OneDrive [closed]
We are using windows server and scheduled phpscript to extract MYSQL data and load into csv file, then upload it to Onedrive. However this process in the recent days seems to be troublesome.
We are ...
-3
votes
0
answers
40
views
data cant be save in database [closed]
i have a registration form and i want to store the information (gender and phone included) but it didnt store in the database even the register is successful but the column for gender and phone_number ...
-3
votes
0
answers
26
views
What is the best way to implement these relations in DB? [closed]
Movie
Stores:
Title
Description
Potentially huge text with a detailed description of the movie
Budget
Release date
Duration
Character
Stores:
Name
Description
Role (Valid values — leading, ...
-2
votes
0
answers
28
views
Laravel 11 Eloquent subquery statement failed [duplicate]
Please help with this subquery to transpile to Eloquent sentence:
SELECT * FROM notifications WHERE id NOT IN (SELECT notification_id FROM notification_seen WHERE user_id = 1)
Sql sentence works ...
0
votes
2
answers
33
views
Using multiple tables for lookup in MySQL
I'm normally pretty good at finding the answer I need by searching, but I'm drawing a blank on this one.
Let's say I have two tables that both have a list of names and ID numbers (we'll call them a ...
-2
votes
2
answers
33
views
Can i make a flexible function that can get * from different tables? [duplicate]
I am trying to create a function that can select from different tables in mysql
My Function
async function getOne(table, table_parameter, parameter) {
const result = await pool.query(
`SELECT * ...
0
votes
1
answer
30
views
MySQL giving me 4 rows,there should be one,I don't know
I'm a beginner apprentice. I don't know why my code is returning extra duplicate rows.
Code:
SELECT *
FROM employees
It returns the list, but repeated multiple times and the first number on the ...
0
votes
0
answers
25
views
Comparing large ints in mysql
I need to know how to query a mysql database to fetch very large ints (48 bytes) within a range. I have set up my table as such:
primary: varbinary(48) primary key
secondary: varbinary(48)
ternary: ...
-2
votes
0
answers
36
views
Storing data from API requests in PHP and mySQL [closed]
I'm developing a API a website for a tourism agency.
All the data (regions, hotels, room types) are populating the database using various APIs from different providers that my client has a B2B ...
0
votes
0
answers
48
views
Connect Timeout expired. Unable to connect to any of the specified MySQL hosts
I'm trying to deploy my api inside a docker container. It was working perfectly but I changed the mysql server parameters and it started giving me the following problem. Does anyone have any idea what ...