mysql-5.6

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

社会主义新天地 提交于 2019-12-22 04:42:34
问题 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

Using utf8mb4 in MySQL

不想你离开。 提交于 2019-12-22 03:48:18
问题 In order to use 4-byte utf8mb4 in MySQL (5.6.11), I have set the following variables in the my.ini file ( my.cnf is not found). This file is located in a hidden folder named Application Data ( C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.6 ) on Windows XP. It is not available under the installation directory. [client] port=3306 default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4 [mysqld] init-connect='SET NAMES utf8mb4' collation_server=utf8mb4

Using “TYPE = InnoDB” in MySQL throws exception

一个人想着一个人 提交于 2019-12-21 03:28:25
问题 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

UPDATE with no subquery throws error: Subquery returns more than 1 row

血红的双手。 提交于 2019-12-20 03:20:59
问题 Can somebody explain to me this... :) (using MySQL 5.6.13) UPDATE offer SET cosid=1 WHERE id=40; Query OK, 1 row affected (0.07 sec) Rows matched: 1 Changed: 1 Warnings: 0 UPDATE offer SET cosid=4 WHERE id=40; ERROR 1242 (21000): Subquery returns more than 1 row UPDATE offer SET cosid=5 WHERE id=40; Query OK, 1 row affected (0.04 sec) Rows matched: 1 Changed: 1 Warnings: 0 Every valid index is accepted except of four :( This is offer table: CREATE TABLE offer ( id bigint(20) NOT NULL AUTO

How to solve mysql warning: “InnoDB: page_cleaner: 1000ms intended loop took XXX ms. The settings might not be optimal ”?

耗尽温柔 提交于 2019-12-17 10:19:29
问题 I ran a mysql import mysql dummyctrad < dumpfile.sql on server and its taking too long to complete. The dump file is about 5G. The server is a Centos 6, memory=16G and 8core processors, mysql v 5.7 x64- Are these normal messages/status "waiting for table flush" and the message InnoDB: page_cleaner: 1000ms intended loop took 4013ms. The settings might not be optimal mysql log contents 2016-12-13T10:51:39.909382Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4013ms. The settings

Why can't I uninstall mysql-5.5 & install mysql-5.6 on Amazon Linux machine?

时光怂恿深爱的人放手 提交于 2019-12-14 00:11:48
问题 I'm on a 64-bit Amazon Linux machine. I had previously installed mysql-server 5.5. (using sudo yum install ) However, I soon found out that my application requires MySql-serve 5.6. So I uninstalled mysql-server 5.5. (using sudo yum remove mysql-server ) and now I'm following these instruction to install mysql-server 5.6. But I'm running into a problem. when I try to do the second install, I get the following 2 errors: file /usr/lib64/mysql/libmysqlclient.so.18 from install of mysql-community

My SQL 5.6 - how to prevent Reads on rows selected by a previous SQL statement PLUS any other row which share a duplicate value in a given column

杀马特。学长 韩版系。学妹 提交于 2019-12-13 20:30:37
问题 I've got a very specifc and quite complex need to prevent Reads coming from massively concurrent (same second, sometimes same milli-second) requests coming from distinct servers (to be precise, they're AWS lambdas) on a table called Hobby_ideas_articles. Set-up: mySQL 5.6 on aws aurora serverless MySQL (autocommit is off by default) I read of course a lot of posts about row locks and think they might be part of the solution but I think I'm not in the basic select...for update case. My table

MySQL - Select data with a JOIN but with WHERE clauses applying to complex and distinct perimeters

点点圈 提交于 2019-12-13 08:04:08
问题 I have a MySQL 5.6 database and fail to make a complex query, which (i think) involve multiple joins. The first table (T1) is Hobby_ideas_articles and records looks like this: hobby_idea_article_id= 1, hobby_id = 6 url= 'http://exo.example.com', author = 'john@example.com' hobby_idea_article_id= 2, hobby_id = 3 url= 'http://exo.example2.com', author = 'john@example.com' hobby_idea_article_id= 3, hobby_id = 6 url= 'http://exo.example3.com', author = 'eric@example.com' hobby_idea_article_id= 4,

which function is good to check whether the given lat & lng is inside the polygon?

为君一笑 提交于 2019-12-13 04:26:17
问题 I have found the following mysql spatial functions which can check a given lattitude and longtitude is inside the polygon or not. 1 - MBR_Contains 2 - MBR_Within Please guide me, which will give fast and accurate result to check a given point is inside or outside of the polygon in MySql server by the query itself. Also Suggest me, If you found any better solution than this ( It should be checked by query in Mysql Server.)? Regards, ArunRaj 回答1: They're likely the same (in terms of speed), but

Very slow (1 second) connections

偶尔善良 提交于 2019-12-10 09:53:32
问题 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