mysql-8.0

docker-compose : The server requested authentication method unknown to the client

混江龙づ霸主 提交于 2020-01-10 18:46:05
问题 I have this yml file for configuration of MySQL in docker: # Use root/example as user/password credentials version: '3.1' services: db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: 'pass' MYSQL_DATABASE: 'db' MYSQL_USER: 'user' MYSQL_PASSWORD: 'pass' adminer: image: adminer restart: always ports: - 8888:8080 And I start the container using following command from the same directory where yml is located: docker-compose -f stack.yml up Then I got this error: 回答1: This worked

Show top N scores in MySQL 8 without duplicates by category

荒凉一梦 提交于 2019-12-24 07:27:05
问题 I have the following table in MySQL 8.0.15: CREATE TABLE golf_scores (person TEXT, score INT); INSERT INTO golf_scores VALUES ('Angela', 40),('Angela', 45),('Angela', 55),('Peter',45),('Peter',55),('Rachel', 65),('Rachel',75),('Jeff',75); SELECT * FROM golf_scores; +--------+-------+ | person | score | +--------+-------+ | Angela | 40 | | Angela | 45 | | Angela | 55 | | Peter | 45 | | Peter | 55 | | Rachel | 65 | | Rachel | 75 | | Jeff | 75 | +--------+-------+ I am trying to get the

PDOException::(“PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109”) with MySQL 8 / PHP 7.2 / Laravel

落花浮王杯 提交于 2019-12-23 14:41:45
问题 I just installed my dev environnement. When I try to connect mysql db via SequelPro, I get: Authentication plugin 'caching_sha2_password' cannot be loaded As stated in: Authentication plugin 'caching_sha2_password' cannot be loaded, I ran: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; Then I could connect my DB via SequelPro But when I execute Laravel Command: php artisan migrate I get: PDOException::("PDO::__construct(): Unexpected server respose while doing

PDOException::(“PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109”) with MySQL 8 / PHP 7.2 / Laravel

混江龙づ霸主 提交于 2019-12-23 14:41:01
问题 I just installed my dev environnement. When I try to connect mysql db via SequelPro, I get: Authentication plugin 'caching_sha2_password' cannot be loaded As stated in: Authentication plugin 'caching_sha2_password' cannot be loaded, I ran: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; Then I could connect my DB via SequelPro But when I execute Laravel Command: php artisan migrate I get: PDOException::("PDO::__construct(): Unexpected server respose while doing

Use SQL REGEXP to ignore number and get only String and '/'

流过昼夜 提交于 2019-12-22 18:00:02
问题 I have a MySQL table with a column of type varchar(255) which holds the data in the following formats: 400 mg 50/12,5 mg/ml 20 mikrog 500 mg/400 IU 60 mikrog/15 mikrog I need to ignore the number and only extract the string(s), in some cases, including / , so that the data from above looks like this: mg mg/ml mikrog mg/IU mikrog/mikrog I tried using REGEXP like this: SELECT DISTINCT REGEXP_SUBSTR(column, '[a-z]') FROM db.table; But, that just gives me a bunch of letters, like this m I U a g k

what are the changes in mysql 8 result rowset case?

我与影子孤独终老i 提交于 2019-12-19 05:09:53
问题 when running SELECT maxlen FROM `information_schema`.`CHARACTER_SETS`; mysql 5.7 and mysql 8 produce different results: on mysql 5.7 the results row names are lower cased, on mysql 8 the results row names are upper cased. NB : in the CHARACTER_SETS table, the comumn name is MAXLEN (upper cased). Since I can't find a resource documenting it, my question is : what are the changes in mysql 8 result rowset case ? 回答1: MySQL 8.0 did change the implementation of some views in the INFORMATION_SCHEMA

Node.js can't authenticate to MySQL 8.0

岁酱吖の 提交于 2019-12-17 04:05:33
问题 I have a Node.js program that connects to a local MySQL database with the root account (this is not a production setup). This is the code that creates the connection: const mysql = require('mysql'); const dbConn = mysql.createConnection({ host: 'localhost', port: 3306, user: 'root', password: 'myRootPassword', database: 'decldb' }); dbConn.connect(err => { if (err) throw err; console.log('Connected!'); }); It worked with MySQL 5.7, but since installing MySQL 8.0 I get this error when starting

How to connect my route parameter in express with @mysql/x devAPI?

被刻印的时光 ゝ 提交于 2019-12-11 15:51:45
问题 Here is my code: var express = require('express'); var router = express.Router(); var mysqlx = require('@mysql/xdevapi'); router.use(`/:email`, function (req, res, next){ mysqlx.getSession( { user: 'username', password: 'password', host: 'localhost', port: '33060' } ) // .then(session => { // console.log(session.inspect()); // }) .then(function (session) { var db = session.getSchema('nms2019local'); var opsTable = db.getTable('operators'); return opsTable .select (['email', 'admin']) .where(

How to use REGEXP on the word boundary in MySQL 8.0.5+?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 14:57:33
问题 It does not work in MySQL (8.0.5+) using ICU-REGEXP to perform a search on the word boundary. As far as I understand it should be a-la $ mysql -e 'SELECT REGEXP_LIKE("aaa abc ccc", ".*\b+abc\b+.*")' +---------------------------------------------+ | REGEXP_LIKE("aaa abc ccc", ".*\b+abc\b+.*") | +---------------------------------------------+ | 0 | +---------------------------------------------+ but this option does not work. 回答1: First, note that REGEXP_REPLACE can match strings partially ,

Show top N rows by category in MySQL 8 without duplicates in another category

别说谁变了你拦得住时间么 提交于 2019-12-11 08:04:01
问题 Similar to this question, I have the following table in MySQL 8.0.15: CREATE TABLE golf_scores (id INT PRIMARY KEY AUTO_INCREMENT, person TEXT, score INT, age INT); INSERT INTO golf_scores (person, score, age) VALUES ('Angela', 40, 25),('Angela', 45, 25),('Angela', 55, 25),('Peter',45, 32),('Peter',55,32),('Rachel', 65, 35),('Rachel',75,35),('Jeff',75, 16); SELECT * FROM golf_scores; +----+--------+-------+------+ | id | person | score | age | +----+--------+-------+------+ | 1 | Angela | 40