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 which all use their own dialects of SQL to manage the data.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

I am working in terminal application(Python+MySQL)

def view_empdetails(): #this is my function: it works great conn = mysql.connector.connect(host="localhost",user="root",passwd="#####",database="#DB") cursor = conn.cursor() # this is ...
0
votes
0answers
6 views

how to limit memory per query in MySQL

Sometimes a single query consumes a lot of resources, which may bring down MySQL. So how do we limit the memory of a single query?
0
votes
0answers
8 views

MySQL Total friends find multiple maximum if exist

I've a MySQL table where you have friends list. +--------------+-------------+-------------+ | requester_id | accepter_id | accept_date | +--------------+-------------+-------------+ | 1 |...
0
votes
0answers
7 views

Advanced MySql Data Transfer Tool

im not sure if a tool i'm looking for even exists, having a hard time locating one remotely close. Here is what i'm hoping to achieve.... right now we have our production mysql server and our staging ...
0
votes
0answers
12 views

MySQL before insert trigger using foreign key

say I have table A and table B, Where the primary key of table A is the foreign key of table B. Table A is an enumeration class with a couple of possible values. However, filling the columns of table ...
0
votes
0answers
8 views

Issues with giving permission to user PHPMYADMIN

I'm trying to give all permissions to a user on phpmyadmin so he can add a collation to his database. However, once I enter the command : ''' GRANT ALL PRIVILEGES ON . TO 'admin'@'localhost'; ''' ...
-1
votes
0answers
18 views

Bluehost database query

I'm fairly new to php and mysql. I'm working on a project, but I've been having trouble querying my database for weeks now. I'm using Bluehost and have the connection variables set, but it doesn't ...
0
votes
0answers
5 views

Getting duration of a list of queries on mysql workbench

I have a list of 600 queries that I want to execute and see their duration so I can export the info to a file for my personal use.Found out about profiles and used the "show profiles command" to see ...
0
votes
1answer
12 views

Using a variable OUTFILE in a MySQL scheduled event

I am using phpMyAdmin to try to schedule an event that runs every hour. I need it to select data from one of my tables and export it to csv that has a unique name which includes the current timestamp. ...
1
vote
1answer
17 views

Get executed sql statement in pymysql

I am executing a query that is invalid, but I'd like to be able to see exactly what the query is being executed by pymysql to debug it. Is there a way to do something like: try: self.cursor....
0
votes
1answer
32 views

Get min / max grouped by two columns

I have 2 tables Parts table: id | part_id | group_id 1 | | 1 2 | 1 | 1 3 | | 1 4 | | 2 Each part related to group and can be related to ...
0
votes
0answers
14 views

Mysql: migrating 4.0 duplicate primary key issue

I'm trying to import a large database from 4.0 to 5.7, and one table is generating a lot of errors for duplicate primary keys. Table schema: +-------------+-----------------------+------+-----+------...
0
votes
1answer
9 views

How to prevent ClearDB (MySQL) from dropping when heroku puts my app to sleep

I have deployed a Spring Boot app on heroku and installed ClearDB addon which is just MySQL database. I am using free plan so I don't mind that my app is going to sleep after an hour of inactivity but ...
1
vote
1answer
15 views

How to display all duplicate value

Is there anyway I could display all the duplicate values in mysql using group by and having +---------+--------------+------------+--------+----------+----------+---------+ | ENumber | EmpName | ...
-1
votes
2answers
48 views

PHP/mysql count duplicates and output as numbers [duplicate]

I want to count duplicates and output them as a number. database: user Sam Sam Tom Tom Tom John and here is my code: $sql = "select user, count(*) duplicates from users group by ...
-2
votes
0answers
13 views

Union WP table with external database table

I want to write a query and display results on html page. the query takes orders list and adds another column from other database table. both tables have same order id column that can be used to ...
-1
votes
1answer
16 views

How to send a formData to mysql with python and react?

I want to save a image in react in a formData and send to python using flask for save it in mysql but i don't know if that is posible or what´s the type of variable that i have to use in mysql that´...
-3
votes
0answers
17 views

How to remove the null's and let the other fields side by side [closed]

How do i remove the null's and let the other fields side by side The table name is Sem
0
votes
1answer
21 views

Filtering by a coalesced LEFT JOIN

I have a MySQL query I'm trying to optimize, that has to do with permissions. Here's a simplified version: SELECT COUNT(*) FROM photo LEFT JOIN photo_access ON viewer=4 AND owner=photo....
0
votes
0answers
16 views

Compare PHP and mySQL database [closed]

I'm Working on a Website and currently working on the login feature, but when I try to compare it just doesn't work. I'm a total noob at PHP and mySQL so it would help a lot if someone could help me ...
0
votes
0answers
7 views

MySQL column privilege overrides global privilege despite no conflict

I have two roles 'r_nddb_read' and 'r_nddb_verify' 'r_nddb_read' is granted 'SELECT' privileges at the schema level: 'r_nddb_verify' is granted 'UPDATE' privileges at the column level in the '...
-1
votes
2answers
30 views

Inserting random data into a table in MySql

Could someone please help me? I don't know what the problem here DROP PROCEDURE IF EXISTS insertRandom; CREATE PROCEDURE insertRandom() BEGIN DECLARE mytime timestamp; SET mytime := '2009-01-01 ...
0
votes
0answers
8 views

I'm having problems with phpmyadmin on Xampp [duplicate]

I just installed xampp and wanted to access phpmyadmin to run sql commands there. I have been greeted with all sorts of errors that are present (reference the screenshot below for clearance) MySQL ...
-1
votes
2answers
21 views

Inserting a point into MySQL 8.0 from workbench

I've got a column called 'coordinates' of type 'point'. This query: update `my-db`.`community` set `coordinates`= POINT( 31.9931217, 35.2823115 ) where 'id' = 1; Returns the following error: ...
0
votes
0answers
23 views

MySQL trigger fails when value is null

I have a MySQL trigger that generates a concatenated value to insert into a table. However, when one of those values is NULL the entire trigger fails to produce any output. I need the trigger to ...
-2
votes
1answer
26 views

Problem with MySQL Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO)

Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in C:\WebServer\Apache2.2\htdocs\mensagens\config.php on line 8 nao e possivel I just write the code again and ...
0
votes
0answers
14 views

PHP Folder Rename and Updating MySQL table

I have a recursive category system on MySQL. When I create a new/sub category, new folder automatically created and path saved on category table. Everythings works fine but when I rename or move a ...
0
votes
1answer
15 views

combining multiple databases for real time app+website [closed]

Before you read any further, this question has no code in it. This is a research question. I'm a web developer migrating to developing apps (android+ios). I'm learning React Native. I'm following ...
-1
votes
1answer
23 views

How to get the user ID from MySQL/Maria DB?

In PostgreSQL, for instance, the query SELECT * FROM pg_user return the usesysid column in which you can see the users IDs. So I can get the oldest/newest user from this table through this ID. How ...
0
votes
2answers
35 views

PHP MYSQL date range search with another filter criteria [closed]

I am trying to search a date range along with another criteria (cost center) and only return that data. I am currently able to search by date range however when I input a cost center it will not ...
0
votes
0answers
12 views

Add data to mysql and reload page from modal in node.js

so basically in my web application, i have a student dashboard, with different modals, one of which adds tasks, now, if i want to submit the form from this modal, how should i handle the save to ...
0
votes
1answer
21 views

Inserting new data in mysql after creating new field

How can I insert new data in column after adding column without using update function. for example "alter table Employee add column Gender varchar(1) after Birthdate then I get wrong when I used this ...
-2
votes
2answers
31 views

Strange behavior in mySQL 8 with order by, limit and parentheses

Supposing I have a table with the following values I perform the following query and get the attached results SELECT * FROM testvalues ORDER BY textval; Everything is good so far. I will now add a ...
0
votes
0answers
12 views

what is the best way to update DB after redis cache update

We have hosted restful web services in Tomcat server with having MySql db for DAO layer and also Redis cache to hold mostly used data for get operations. the problem is, when the load is higher (...
0
votes
1answer
40 views

PHP/mysql:Rank users by clicks

So i want to rank users by clicks here is my code: <!DOCTYPE html> <html> <head> <title>User ranking</title> </head> <body> <table style="width:100%"> ...
0
votes
1answer
27 views

Create a function / procedure / loop for creating multiple tables of same structure in MYSQL

Is there any way of creating multiple tables of same structure either using loop / function / procedure ? I know there is a method of "like" but I'm looking for other options too for knowledge sake. ...
0
votes
1answer
24 views

How to JOIN two SQL tables to get a specific additional data based on matching id's

I haven't done a JOIN query in a long time, so I'm pretty rusty. What I have: a table called triggers and users. Initially, I just had a query that selected all of the information from the triggers ...
0
votes
2answers
39 views

Async/Await nodejs mysql function

I have a problem with nodejs, in practice as you can see from the two modules that I entered via google drive link, I have a problem with the login form because although I have entered asyn / await in ...
0
votes
1answer
13 views

How to create a (multi-field) search form in MS Access with MySQL Backend?

I'm creating an Access form frontend for a MySQL backend, and I'm wondering if there's a way to create a search form for a table that searches multiple fields. When looking for answers on this topic, ...
1
vote
1answer
27 views

MYSQL - How do I use a SELECT as my WHERE

I have two tables recordings and recording_metas and I want to select some metas and use the foreign keys from those metas to find the corresponding recording. This is what I have so far. $...
0
votes
0answers
13 views

what the datatype of multivalue : list of string in SQL?

I want to know what the datatype of a list of strings in SQL? how can I store a list of String in my database? I am working in application and there is a checkbox to choose hobbies, more than one, so ...
0
votes
2answers
43 views

Unable to SELECT form DB with ORDER BY and php IF

i use following to statement to load data form SQL the SELECT query works well until php IF is executed. i want to use 2 ORDER BY in single statement when if statement is executed i get Fatal ...
1
vote
1answer
16 views

Magento join only selected table column, avoid ambiguous

I am trying to join two tables and then filtering it by product_id... The problem is that both tables have the same column and I am getting following error Integrity constraint violation: 1052 ...
0
votes
0answers
20 views

Create C# Mysql Project Setup

I want to create setup for my C# simple 'Login' project. I have used Mysql database for this project. I couldn't find any concrete explanation on the internet. When I create setup and install on my ...
-1
votes
0answers
23 views

PHP While Loop No Showing Results [closed]

I can get the: echo "we got results"; to populate when code is run, but no results input into the form. All SQL names where copy/pasted from myPHPAdmin to avoid typo errors. <?php include_once ...
0
votes
1answer
39 views

mysql group by, right join. order not work

How to sort this query by messages date DESC. This return first row. SELECT `u`.`username`, `u`.`id` AS `user_id`, `m`.`text`, `m`.`date` FROM `users` AS `u` ...
0
votes
1answer
30 views

**SQLAlchemy**:Get a count of one column where another column is distinct

This is killing me! I'm sure it's a gap in my SQL knowledge, but I'm having massive trouble solving this issue. I need to get a count of all orders for each country. The catch is the orders need to ...
1
vote
0answers
18 views

Sequelize LEFT JOIN only single column value

So I have next structure: Comments, Users, Likes. Users has many likes, Comments has many likes. I'm trying to get all Comments and check if User liked them. I have a raw query with LEFT JOIN that ...
0
votes
1answer
28 views

i am trying to create a view table and keeps showing up with this error 1052

Why is it showing that the employee id is ambigous i am trying to show a view table of monthly sales figures for each individual shop for 2018: display the shop by name, The manager of the shop by ...
-1
votes
0answers
19 views

Async/await nodejs and mysql - Support [closed]

I have a problem with nodejs, in practice as you can see from the two modules that I entered via google drive link, I have a problem with the login form because although I have entered asyn / await in ...