Category "mysql"

Mixing two tables together

I have two tables db2: id, db1id, text, count_db1 db1: id, text db2 above is created by SELECT *, COUNT(`db1id`) AS count_db1 FROM `db2` GROUP BY `db1id

MySQL server has gone away without huge data but due to long time

The script takes too much time and so I am getting this error. I will try to optimize it. I want advice, will using, mysql_pconnect is better than mysql_connect

NameError: name '_mysql' is not defined after setting change to mysql

I have a running Django blog with sqlite3 db at my local machine. What I want is to convert sqlite3 db to mysql db change Django settings.py file to serve MySQL

My query won't work due to order by Clause

I am writing query for displaying data and added order by clause in that query. My query Is SELECT * FROM `coupons` WHERE `status` = 'A' && `type` = '

php mysql + create a friend request system

i am creating a friend request system that allow user to send request to each other to add as friends like facebook and i have 2 conditions that if : the us

Creating a table with the name being a variable date?

I wanted to create a table with the name of the table being a date. When I gather stock data for that day, I wanted to store it like this: $date = date('Y-m-d'

java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z

I am trying to connect my Servlet to mysql database using data Source . But whenever I run my servlet I end up getting this exception : java.lang.AbstractMetho

How should I resolve --secure-file-priv in MySQL?

I am learning MySQL and tried using a LOAD DATA clause. When I used it as below: LOAD DATA INFILE "text.txt" INTO table mytable; I got the following error:

SQLAlchemy group_concat ordered values

I want simulate the behaviour of collect_set in SQLAlchemy (using MySQL connector). i.e. group A 1,2,3 would be the same as 2,1,3. I have the following code: r

unable to import MySql.Data.MySqlClient

I have created a website that uses a MySQL database, but when i put it online, it doesn't work anymore. in my class connection.vb that i use for my connection t

TypeORM find where clause, how to add where in multiple parameter

this.sampleRepo.find ( { where: { id: In ["1","7","13"] } order: {

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

The problem Im facing while trying to connect to database for mysql. I have also given the database settings that i have used. Traceback (most recent call las

how to make my own auto increment in php?

The in-built Auto-Increment in MySQL doesn't meet my requirement so I'm thinking about making a new one. Here is my requirement: Create an increment serial num

Querying only one row from a one to many relationship laravel

I have a products table and a product_pictures table, where a single product can have many pictures (one to many relationship). I am trying to display all of th

Querying only one row from a one to many relationship laravel

I have a products table and a product_pictures table, where a single product can have many pictures (one to many relationship). I am trying to display all of th

mysql insert current_user() by default

I have a table like create table try ( firstname varchar(4), username varchar(4)) My question is that is there a way to insert the current_user() or user() valu

How to write a query to find Median of column in a Table in MySql?

I was trying to solve problem in Hackerrank SQL Practice section and stuck in Problem 'Weather Observation Problem 20'. To find Median, I though of the followin

TypeORM throws QueryFailedError Table already exists on MySQL when synchronize is true

I am using NestJS, TypeORM, and MySQL to build a web application. I am using a .env file to pass in some environment variables for connecting to my local datab

SQL formula to match all words in any order in just one statement

I would like to have a SQL formula to match all the words in a query in any order without using multiple 'AND like' statements. For example, the query 'cat dog

#1062 - Duplicate entry '_site_transient_timeout_theme_roots' for key 'option_name'

I'm migrating a site from Site5 hosting to InMotion Hosting and the importation of the mysql file (via phpMyAdmin) is not working. import of mysql file failed,