mariadb

How to upgrade mariadb from a sql dump file?

一世执手 提交于 2021-01-29 11:58:25
问题 I have a sql dump file generated by mysqldump of mariadb 10.2. I want to set up a new db server using mariadb 10.4 with data coming from the sql dump file. Is the upgrade process necessary in this case? If so, should I first restore the sql file into db and then run mysql_upgrade or somehow directly upgrade the sql file and then restore into the db? 回答1: Well I would suggest that you follow the upgrade guides given on the MariaDb website. See Upgrading MariaDB. It lists articles on upgrading

Problems with ORDER BY RAND() and big tables

泄露秘密 提交于 2021-01-29 11:15:04
问题 Hello I asked a question this morning, and I realized that the problem was not where I was looking (here the original question) I have this query to randomly generate registries from an address book. SELECT * FROM address_book ab WHERE ab.source = "PB" AND ab.city_id = :city_id AND pb_campaign_id = :pb_campaign_id AND ab.id NOT IN (SELECT address_book_id FROM calls WHERE calls.address_book_id = ab.id AND calls.status_id IN ("C","NO") OR (calls.status_id IN ("NR","OC") AND TIMESTAMPDIFF(MINUTE

mariadb won't create foreign key

泪湿孤枕 提交于 2021-01-29 10:54:13
问题 I think I'm using the right syntax for MariaDB, but my foreign key constraint is not being created. Here's the create table DDL: CREATE TABLE items ( id INT auto_increment primary key, description TEXT NOT NULL ); CREATE TABLE item_events ( id INT NOT NULL, calendar_event_guid TEXT(255) NOT NULL, foreign key item_events_id_fk (id) REFERENCES items (id) ); Then, when I ask MariaDB to show me what I created, I get this: +-------------+----------------- | Table | Create Table +-------------+----

MariaDB take long time to execute

一曲冷凌霜 提交于 2021-01-29 10:52:14
问题 I have a table with 500 rows of data in "MariaDB-10.3.1" When i run "TURNUCATE, ALTER, DROP, RENAME" operations take a long time for execution and nothing happend, i wait 30 minutes for 500 rows of data but not finished execution. anyone can help me to solve the problem? 回答1: I use SELECT concat('KILL ', ID, ';') FROM INFORMATION_SCHEMA.PROCESSLIST WHERE `db` IN (DATABASE_NAMES); and kill all process then my query worked. Thank you all. 来源: https://stackoverflow.com/questions/64133377/mariadb

MariaDB LIMIT statement brings more than limit

烂漫一生 提交于 2021-01-29 09:24:45
问题 I have 10,000 users on registrations table and want to limit this query to 3500 users from my application. But when I investigate the logs , sometimes it counts more than 3500. I can not understand why that query returns more than limit: select count(*) from registrations where (selectedtime IS NULL AND expirationtime < NOW() ) LIMIT 3500; I tried manually on DB and saw sometimes more than 3500 回答1: Your query only returns 1 row, which is less than 3500. If you want to limit the number of

MariaDB SSL connection error: Unsupported record version Unknown-0.0

余生颓废 提交于 2021-01-29 09:11:17
问题 My environment: OS: centos 7.6.1810 database: 10.3.14-MariaDB jdbc driver: mariadb-java-client 2.4.1 jdbc parameter: jdbc:mysql://db_ip:3306/dbname?useUnicode=true&characterEncoding=utf8mb4&useSSL=true&trustServerCertificate=true java: openjdk version "1.8.0_201" ap server: wildfly 16 MariaDB SSL configuration tested below: mysql mysql --ssl MariaDB [mysql]> status -------------- mysql Ver 15.1 Distrib 10.3.14-MariaDB, for Linux (x86_64) using readline 5.1 Connection id: 68 Current database:

MariaDB connection to ExpressJS access denied no password error

那年仲夏 提交于 2021-01-29 08:40:52
问题 I'm trying to connect an Express app to MariaDB, both running on localhost. I have the following code in an Express app: const mariadb = require('mariadb'); const pool = mariadb.createPool({ user: 'testuser', password: 'password', database: 'test', connectionLimit: 5 }); I can connect using 'testuser' from the MariaDB command line, but when Express executes the code above, I see the following in the console: SQLError: (conn=63, no: 1698, SQLState: 28000) Access denied for user 'testuser'@

Get groups of object ids with datetime grouped by date

↘锁芯ラ 提交于 2021-01-29 07:42:00
问题 Let's say we have table like this: +----------------------------------+----------------------------+ | id | start | +----------------------------------+----------------------------+ | 06c561305383482e98064ssdfd6ccf74 | 2019-08-30 14:41:40.697301 | | 0aec07d9acdd48c485ab3sfhsffdsa8c | 2019-09-02 05:45:09.274541 | | 0d240asdfasd49579e2be8821b908fdc | 2019-09-02 05:45:08.745885 | | 00al4eebb9a34sdsdfsdff128518dc4f | 2019-08-30 14:42:29.094314 | Is it possible to get data in structure similar to

Laravel Nginx Every Second Request Handle

浪尽此生 提交于 2021-01-29 07:04:08
问题 i want to ask about the request handle The case is, if server receive the same post request or the same key parameter, the request is on hold first or stored until there are no more requests for 5 seconds or a certain condition. and after that the request is processed to the database So from the client site send post every second, but server don't need to process it to the database every second, just the most recent request Has anyone ever known about such needs, using what methods, maybe

Hibernate optimistic locking different behavior between Postgres and MariaDb

两盒软妹~` 提交于 2021-01-28 11:21:29
问题 I just discovered that my application behaves differently when I use optimistic locking with a Postgresql or a MariaDB database and I am wondering if somebody can explain what happens and how could I make the application work in the same way with MariaDB? I use Postgresl 10.5 and MariaDB 10.3.10 with InnoDB engine and default settings. I use Spring framework version 5.1.0 and Hibernate 5.3.6. So my code looks like this: @Entity @Getter @Setter @NoArgsConstructor public class Bla { @Id