The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

Get rid of @num_rows and @i; you can loop without counting. There are lots of examples floating around. You must construct the query something like SET @stmt := CONCAT('SELECT "', col_name, '", ' MIN(', col_name, '), ', ' MAX(', col_name, ')', ' FROM ', tbl_name'); The intent is to ...


0

If B.field1 has a collation ending with _ci, then the UPPER is not needed; get rid of it. Then you need INDEX(field1); do you have it? And what about the ...? So far, I see no use for including C in the query.


0

I know this is an old one but it is not valid anymore, with MySQL >= 8.0.17 cf MySQL Function Found_Rows() So we still have to issue both queries ie. add one with the COUNT(), unfortunately.


0

As you can see on https://www.w3schools.com/sql/func_mysql_cast.asp SIGNED Converts value to SIGNED (a signed 64-bit integer) UNSIGNED Converts value to UNSIGNED (an unsigned 64-bit integer) And from the official MySQL documentation: https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html MySQL supports arithmetic with both signed and ...


0

I think I have seen cases where buffer_pool is set really low (much less than 128M) The transaction was complex, not simply "big". Errors indicated that the buffer_pool was out of space (or something like that). You are checking for errors, yes? "Big" is not a problem -- InnoDB is designed to handle arbitrarily many rows being held for ROLLBACK, etc. But ...


0

Mysql (community) Version 8.0.17-1.sles12 - OpenSUSE tumbleweed 2019.10.02 mysql> SET GLOBAL expire_logs_days = 4; ERROR 3683 (HY000): The option expire_logs_days and binlog_expire_logs_seconds cannot be used together. Please use binlog_expire_logs_seconds to set the expire time (expire_logs_days is deprecated) ..


-2

You should add the PRIMARY KEY parameter to the STAFF table. CREATE TABLE STAFF (PKSTAFF_ID VARCHAR (20) PRIMARY KEY, NAME VARCHAR(50), ADHAAR_NO BIGINT (12), CONTACT_NO BIGINT(10) );


0

SELECT country, COUNT(state) total, SUM(state='xxx') xxx, SUM(state='yyy') yyy, SUM(state='zzz') zzz FROM table GROUP BY country


0

CLIENT SIDE Before you run this LOAD DATA local infile '/home/pi/Downloads/load_data_infile.txt' INTO TABLE test_tbl FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; You need to start mysql client program with --local-file mysql --local-file -uroot -p If you wish to have this configured permanantly, add this to ~/.my.cnf [mysql] local-infile This ...


1

I just encountered a question 5 days ago : InnoDB errors and crashes with MyISAM database? When troubleshooting the issue in a live chat session, I discovered that dirty pages from Temporary InnoDB Tables were occupying the InnoDB Buffer Pool. The file ibtmp was 482MB with 75% of the buffer pool being dirty since innodb_max_dirty_pages_pct was 75. The ...


Top 50 recent answers are included