mysql-5.6

~150ms on a 2 million rows MySQL MyISAM table

混江龙づ霸主 提交于 2019-12-08 20:51:37
I'm learning about MySQL performance with a pet project consisting of ~2million rows + ~600k rows (two MyISAM tables). A range query using BETWEEN on two INT(10) indexed columns, LIMITed to 1 returned result takes about 160ms (including an INNER JOIN). I figure my configuration isn't optimised and am looking for some advice on how to either diagnose, or perhaps "common configuration". I created a gist containing both tables, the query and the contents of my.cnf. I created the b-tree index after inserting all data which was imported from a CSV file from MaxMinds open database . I tried two

Mysql 5.6 is not working in Mac OS

。_饼干妹妹 提交于 2019-12-08 13:46:30
问题 Mysql 5.6 is constantly creating problem in Mac OSX. Its constantly disconnecting the server. And throwing certain errors like /tmp/mysql.sock doesn't exist The same with Mysql 5.6.14 installed via DMG: $ mysql ERROR 2013 (HY000): Lost connection to MySQL server at 'sending authentication information', system error: 32 And authentication packet lost errors. I have to kill the process id every time and then had to run the mysql -u root -p all over again. But same thing happens again and again.

MySQL - can't retrieve max value within a left join and 2 distinct select perimeters

心已入冬 提交于 2019-12-08 04:37:20
问题 I'm using MySql 5.6 and I have 2 tables (simplified them to reduce nb of columns to what matters for this question) with a query that is using today a LEFT JOIN to Select rows. Here is the fiddle to test your solution: https://www.db-fiddle.com/f/nGVFhr3xMwKk9CDw6N6FWc/13 Table 'query_results' +-----------------------------+------------+--------------+----------- | query_result_id | query_id | author | datecol +-----------------------------+------------+--------------+----------- | 100 | 1 |

~150ms on a 2 million rows MySQL MyISAM table

半世苍凉 提交于 2019-12-08 04:11:30
问题 I'm learning about MySQL performance with a pet project consisting of ~2million rows + ~600k rows (two MyISAM tables). A range query using BETWEEN on two INT(10) indexed columns, LIMITed to 1 returned result takes about 160ms (including an INNER JOIN). I figure my configuration isn't optimised and am looking for some advice on how to either diagnose, or perhaps "common configuration". I created a gist containing both tables, the query and the contents of my.cnf. I created the b-tree index

Very slow (1 second) connections

强颜欢笑 提交于 2019-12-05 18:37:09
I'm running MySQL 5.6 (64-bit) on Windows 7. I'm testing a DB recently upgraded from MySQL 5.0 on 32-bit Windows 7. (I also copied my.ini, with a few changes) I'm finding that it takes a very long time to establish a connection (on the order of 1 second). As an example, I created a very simple SQL script: select 1 as n; I then ran this in a batch file 10 times which took 10 seconds to complete: mysql -h localhost -u root -D myschema 0< myscript.sql (Yes, there is no password here, this is a test DB listening only to 127.0.0.1) Anyone have an idea why this is so very slow? (See my.ini below)

What does the MySQL 5.6 error “InnoDB presently supports one FULLTEXT index creation at a time. Try LOCK=SHARED” mean?

社会主义新天地 提交于 2019-12-05 17:16:23
In MySQL 5.6.22 (specifically running on Amazon RDS) I once had a fulltext index on a table. I have since dropped that index in favor of using sphinxsearch. There are no more fulltext indexes on any of the tables on the database. When I try to now perform an online DDL such as adding a tinyint column to a table with LOCK=NONE I get this error: InnoDB presently supports one FULLTEXT index creation at a time. Try LOCK=SHARED. But, there are no fulltext indexes anywhere. I've even tried creating a read-replica in Amazon in hopes that the rebuilding of the database would fix that and I get the

How to migrate MySQL data directory in docker container?

落花浮王杯 提交于 2019-12-05 16:48:59
问题 I have a docker container running MySQL-5.5 with host data volume. I am upgrading my container to MySQL-5.6. I am starting a new container with the same host volume. MySQL was crashing in the container due to the crash of mysql.user table. [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'user'; try to repair it 160523 12:04:13 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended I tried the following to fix that: root@container# mysqld -

Sql syntax: select without from clause as subquery in select (subselect)

自古美人都是妖i 提交于 2019-12-05 03:46:28
While editing some queries to add alternatives for columns without values, I accidentally wrote something like this (here is the simplyfied version): SELECT id, (SELECT name) FROM t To my surprise, MySQL didn't throw any error, but completed the query giving my expected results (the name column values). I tried to find any documentation about it, but with no success. Is this SQL standard or a MySQL specialty? Can I be sure that the result of this syntax is really the column value from the same (outer) table? The extended version would be like this: SELECT id, (SELECT name FROM t AS t1 where t1

How to migrate MySQL data directory in docker container?

谁都会走 提交于 2019-12-04 02:22:30
I have a docker container running MySQL-5.5 with host data volume. I am upgrading my container to MySQL-5.6. I am starting a new container with the same host volume. MySQL was crashing in the container due to the crash of mysql.user table. [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'user'; try to repair it 160523 12:04:13 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended I tried the following to fix that: root@container# mysqld --skip-grant-tables; root@container# mysql -uroot -ppassword mysql> repair table user USE_FRM; +-----------

Using “TYPE = InnoDB” in MySQL throws exception

怎甘沉沦 提交于 2019-12-03 09:40:48
When I try to execute the following SQL in MySQL , I'm getting error: SQL: SQL = "CREATE TABLE Ranges ("; SQL += "ID varchar(20) NOT NULL, "; SQL += "Descriptions longtext NULL, "; SQL += "Version_Number int NULL, "; SQL += "Row_Updated bigint NULL, "; SQL += "Last_Updated datetime NULL, "; SQL += "XML longtext NULL, "; SQL += "PRIMARY KEY (ID)"; SQL += ") " + "TYPE = InnoDB"; Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "TYPE = InnoDB" But if I remove "TYPE = InnoDB" , then the query works fine.