Category "mysql"

Ubuntu 20.04 - Stopped MySQL. Now it won't start (error 13, permission denied)

Running a DigitalOcean LAMP Stack (1GB VPS) on Ubuntu 20.04, I was getting intermittent "Error establshing a database connection" errors in Wordpress when uploa

Write a Query in MySql server that prints a list of employee names who have been employed for less than 10 months having salary>2000

I want a SQL query that prints a list of employee names who have been employed for less than 10 months having salary>2000. Sort this result by ascending emp_

"Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?" in Next.js API route

Before I was trying to connect mysql to server, I already connect mysql to my localhost and it works. But now I'm trying connect mysql to a server and it does n

MySQL format number with unknown number of decimal places

In MySQL, I only want to add thousand separator in the number like 1234.23234, 242343.345345464, 232423.22 and format to "1,234.23234", "242,343.345345464", "23

Creating procedure that add value when it doesn't exist (Syntax error)

I'm trying to create a procedure that add a value that doesn't exist but I'm currently getting a syntax error. I don't know how to correct the error. Any help w

Django & MeMSQL Error when running migrate.py: django.db.utils.OperationalError: (2012, 'Error in server handshake')

I have a Django application with a default MySQL database. I want to move my default Database to MeMSQL. I set the credentials in settings.py to be: DATABASES =

Problem when creating mysql database on M1 mac: symbol not found in flat namespace '_mysql_affected_rows

I'm trying to create a db for my rails project using [email protected] which was installed via homebrew. The installation was succesfull, but when I try to run: bin/rak

Got Error while installing mysqlclient in django project on cPanel

Requirements.txt contains: asgiref==3.4.1 Django==3.2.9 django-isbn-field==0.5.3 mysql-connector-python mysqlclient phonenumberslite==8.12.42 Pillow==9.0.1 pyth

IF statement sub query optimisation in MySQL

select if(`num`>99, (select `value` from `sub` where `id`=`main`.`num`), "") as `result` from `main` This all works fine but MySQL is very inefficient as i

IF statement sub query optimisation in MySQL

select if(`num`>99, (select `value` from `sub` where `id`=`main`.`num`), "") as `result` from `main` This all works fine but MySQL is very inefficient as i

I cannot create a auto generated date time in mysql workbench

I'm trying to create an auto-generated date-time using MySQL workbench, timestamp seems not working This is the error Operation failed: There was an error whil

Drupal cannot access MySQL Docker container

This is relevant for Drupal 8.9.3, MySQL 5.7 and Docker (with docker-compose.yml) file. Specifically on the Drupal Install step "Set up database", Drupal throws

Hashing gives different result

I am using Python and MySql to handle user authentication. I have added the users thru python with the exact same method, but when I try to do the "login"/authe

Convert MySQL Select query into an Update query

I am using MySql to update the last line ( Member_id = 140) of database users of a column Sponsor_Parent with the result of a Selection of the last line of the

Error inserting values in SQL: Unknown column 'nan' in 'field list'

for row in dfp.itertuples(): cursor.execute(''' INSERT INTO players (PID, NAME) VALUES (%s,%s) ''', (row

How to write a query using multiple 'IN' or any other keywords in SQL so that the condition being applied will be based upon the order defined

I want to fetch records from the database as : select * from table where column1 IN (aa, bb , cc...) and column2 IN (34, 55, 66...) and column3 IN(df, fg, hh...

Gitlab CI/CD Spring boot Mysql sample Build and db connection successful but Junit test failing with Unknown database issue..! (DB exist)

Applying CI/CD With Spring Boot MySQL Gitlab I'm created very basic Spring boot crud application with MySQL, What I need to implement is Gitlab CI pipeline to a

Get the breadcrumb directory sequence in one query using MySQL

I am supposed to get the breadcrumb or directory hierarchy of a folder based on folder id. ID title parent_id 1 Home 0 2 First 1

Azure MySQL database hung when run SELECT * FROM information_schema.statistics query

When I run the SELECT * FROM information_schema.statistics query database stopped processing other requests. At that time Azure monitoring display significant

Logic Behind SQL Select Statement

Lets start with a basic SQL statement like this: SELECT CustomerName, City, Country FROM Customers; We get something like this: CustomerName City Country Alex