New answers tagged

1

The unsigned value 4294967295 has the same binary representation as signed -1. So I suggest that it is reporting "-1 seconds". Either your machines are not in sync on time, or it is a bug in MySQL. I have several seen other cases where "the clock ran backwards", even on machines that are synced with the time service. Consider finding or filing a bug with ...


0

You might want to look at the following links: https://bugs.mysql.com/bug.php?id=79272 https://www.percona.com/forums/questions-discussions/mysql-and-percona-server/43922-fatal-error-trying-to-sync-percona-5-7-slave-to-mysql-5-5-master Seems like you need to upgrade to 5.6 prior to replicating to 5.7 from 5.5. Too bad, the documentation is so cryptic " ...


1

Use a SQL commands like this: mysql -u user -p -e 'Your SQL Query Here' database-name to figure out what users are accessing your db. In the results, did you only see localhost and 127.0.0.1 for the host? This would mean that only these two hosts are allowed for access. you can try: GRANT ALL PRIVILEGES ON *.* TO 'root'@'myIPaddress' and don't forget ...


1

based on the log file there is a transaction run that consume all of the memory, if you want to stop the crash you need either: increase memory for MySQL. at least by double memory value to test if the new memory that reserved to MySQL is enough. reformat the transaction to take less memory.


1

What you are looking for does not exist in MySQL 5.5 Unfortunately, the ALTER USER command for MySQL 5.6 is limited. All you can do is ALTER USER user@host PASSWORD EXPIRE; In MySQL 5.7, you could run the ALTER USER command as follows ALTER USER user@host REQUIRE NONE; When it comes to MySQL 5.5, you did the most expedient way possible. Great !!! A ...


2

query_cache_size = 1G -- This is really bad. Don't set it bigger than about 50M. It won't directly cause a crash, but it can cause lengthy stalls, which could lead to a crash. When any write occurs to a table, all entries in the QC for that table is purged. The bigger the QC the longer that takes. The QC is "in front of" the engines (MyISAM and InnoDB). ...


1

Do not delete the iblog files. You probably have innodb_fast_shutdown = 1, which lets you shutdown fast, at the expense of some extra effort on startup. The files are needed. Change my.cnf - add or increase setting for innodb_buffer_pool_size in the [mysqld] section. Stop mysqld Start mysqld Generally 70% of available RAM is a good value. Version ...


1

Changing innodb_buffer_pool_size doesn't need you to nuke ib_logfiles. This could easily be the reason for you had to restore the database (*). Just stop mysql -> change the settings in my.cnf -> start mysql. (*) ib_logfiles are holding recovery data, pages which were not yet checkpoint to the tablespace. If you remove them without making sure you ...


2

Query 1 Show 1 if the latest ID row in the database has scan date of today otherwise show 0. Can be written more simply (and more efficiently): SELECT CASE WHEN scan.date = CURDATE() THEN 1 ELSE 0 END AS datecheck FROM scan ORDER BY scan.id DESC LIMIT 1 ; and (if we like obfuscation): SELECT (scan.date = CURDATE()) AS datecheck FROM scan ORDER BY ...


4

Rephrasing your query it seems like you simply want to check if there's no row with today's date. It's a bit tricky to make it an conditional Insert: INSERT INTO scan (id, date) SELECT (MAX(id)+1), CURDATE() FROM scan HAVING COUNT(CASE WHEN scan.date = CURDATE() THEN 1 end) = 0; To make it work even with an empty table change to (COALESCE(MAX(id),0)+1)


2

The datatype DATETIME used to be only yyyy-mm-dd hh:mm:ss. But, beginning with 5.6.4(?), fractional seconds were allowed. DATETIME(6) allows for microseconds: yyyy-mm-dd hh:mm:ss.ffffff. If you want that CREATE to work on both versions, remove the (6). Notice how the error message pointed exactly at that.


1

The CREATE INDEX syntax requires an index name, whereas the ALTER TABLE ADD INDEX syntax doesn't. This question as already been asked and answered and should be marked as a duplicate.



Top 50 recent answers are included