mysql-8.0

How to grant all privileges to root user in MySQL 8.0

醉酒当歌 提交于 2021-01-29 19:56:03
问题 Tried mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; Getting ERROR 1064 (42000): 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 'IDENTIFIED BY 'root' WITH GRANT OPTION' at line 1. Note: The same is working when tried in previous versions. Also tried mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; Getting ERROR 1410 (42000): You are not allowed to

Prepared statement in an array and bind() for X DevAPI

我与影子孤独终老i 提交于 2021-01-29 15:00:53
问题 I want the statement to search a number of Ids. Like so. const idsStr = "41, 42, 43"; const sqlStr = `SELECT * FROM table where id IN (${idsStr})`; session.sql(sqlStr).execute() But if I use bind method, it only captures the first instance of the string, the remaining values are ignored. const idsStr = "41, 42, 43"; const sqlStr = `SELECT * FROM table where id IN (?)`; session.sql(sqlStr).bind(idsStr).execute() I want to make prepared statement according to the API currently support so as to

How to fix ERROR 1726 (HY000): Storage engine 'MyISAM' does not support system tables. in Mysql 8.0 after CREATE USER

不羁岁月 提交于 2021-01-27 04:37:34
问题 I have an installation of Debian Stretch and a new installation of Mysql 8.0 (no changes in configuration yet). When I try to create a new user with: mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'xyz'; I got the following: ERROR 1726 (HY000): Storage engine 'MyISAM' does not support system tables. [mysql.db] Any suggestion about what the problem could be? Thank you 回答1: I had restored a DB backup into my new dev MySQL 8 system without thinking and overwrote the MySQL database tables.

How to fix ERROR 1726 (HY000): Storage engine 'MyISAM' does not support system tables. in Mysql 8.0 after CREATE USER

大城市里の小女人 提交于 2021-01-27 04:36:23
问题 I have an installation of Debian Stretch and a new installation of Mysql 8.0 (no changes in configuration yet). When I try to create a new user with: mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'xyz'; I got the following: ERROR 1726 (HY000): Storage engine 'MyISAM' does not support system tables. [mysql.db] Any suggestion about what the problem could be? Thank you 回答1: I had restored a DB backup into my new dev MySQL 8 system without thinking and overwrote the MySQL database tables.

MySQL 8 ignoring integer lengths

让人想犯罪 __ 提交于 2021-01-20 07:06:42
问题 I have a MySQL 8.0.19 running in a Docker container and using the InnoDB engine. I have noticed that table integer field lengths are getting ignored. The issue occurs with integer datatypes regardless if running a CREATE or ALTER query CREATE TABLE `test` ( `id` int DEFAULT NULL, `text_field` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `decimal_field` decimal(6,2) DEFAULT NULL, `int_field` int DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; The

MySQL 8 ignoring integer lengths

六眼飞鱼酱① 提交于 2021-01-20 07:06:26
问题 I have a MySQL 8.0.19 running in a Docker container and using the InnoDB engine. I have noticed that table integer field lengths are getting ignored. The issue occurs with integer datatypes regardless if running a CREATE or ALTER query CREATE TABLE `test` ( `id` int DEFAULT NULL, `text_field` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `decimal_field` decimal(6,2) DEFAULT NULL, `int_field` int DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; The

How to fix “mbind: Operation not permitted” in mysql error log

邮差的信 提交于 2020-12-24 06:39:26
问题 I have a problem with my MySQL error log which currently mostly consists of "mbind: Operation not permitted" lines (see below). Why does it happen and how do I fix it? It's the "mostly" part that bothers me. As you can see below, not all lines are "mbind: Operation not permitted". I suspect that MySQL query errors should be instead of that line, but for some reason they can't be written into the file. MySQL itself is a Docker container where log files are volumed via: volumes: - ./mysql/log:

Very slow writes on MySQL 8 - waiting for handler commit

自闭症网瘾萝莉.ら 提交于 2020-12-10 16:07:02
问题 I have MySQL 8 docker installation installed on an edge device which has the following two tables to write to video_paths | CREATE TABLE `video_paths` ( `entry` int(11) NOT NULL AUTO_INCREMENT, `timestamp` bigint(20) NOT NULL, `duration` int(11) NOT NULL, `path` varchar(255) NOT NULL, `motion` int(11) NOT NULL DEFAULT '0', `cam_id` varchar(255) NOT NULL DEFAULT '', `hd` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`entry`), KEY `cam_id` (`cam_id`), KEY `timestamp` (`timestamp`) ) ENGINE

Very slow writes on MySQL 8 - waiting for handler commit

拈花ヽ惹草 提交于 2020-12-10 16:06:06
问题 I have MySQL 8 docker installation installed on an edge device which has the following two tables to write to video_paths | CREATE TABLE `video_paths` ( `entry` int(11) NOT NULL AUTO_INCREMENT, `timestamp` bigint(20) NOT NULL, `duration` int(11) NOT NULL, `path` varchar(255) NOT NULL, `motion` int(11) NOT NULL DEFAULT '0', `cam_id` varchar(255) NOT NULL DEFAULT '', `hd` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`entry`), KEY `cam_id` (`cam_id`), KEY `timestamp` (`timestamp`) ) ENGINE

MySQL not updating information_schema, unless I manually run ANALYZE TABLE `myTable`

走远了吗. 提交于 2020-08-27 21:53:29
问题 I have the need to get last id (primary key) of a table (InnoDB), and to do so I perform the following query: SELECT (SELECT `AUTO_INCREMENT` FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = 'mySchema' AND `TABLE_NAME` = 'myTable') - 1; which returns the wrong AUTO_INCREMENT. The problem is the TABLES table of information_schema is not updated with the current value, unless I run the following query: ANALYZE TABLE `myTable`; Why doesn't MySQL update information_schema automatically,