问题标签 [mariadb]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
14812 浏览

mysql - MariaDB 客户端默认使用 UTF-8

如何让 MariaDB 客户端使用 UTF-8?我对等效版本的 MySQL 没有这个问题。 我正在尝试在不SET NAMES通过客户端发布的情况下执行此操作。 我使用 cmd 行客户端和 php 的 mysqli 驱动程序获得 latin1。

PHP mysqli_get_charset:

这是命令行客户端的输出:

这是我的 my.cnf 文件。

0 投票
1 回答
289 浏览

mysql-connector - MySQL C 连接器:从单独的线程执行查询

我在应用程序的主线程中创建与服务器的连接:

稍后与服务器建立连接:

现在我使用 mpMySQL 来执行查询:

虽然应用程序在主线程中使用 ClassA 的对象 - 一切正常。

但是如果方法

从线程调用 - 应用程序在执行时崩溃

======

据我了解,这是因为 mpMySQL 在一个线程中初始化并在另一个线程中使用。我对吗?

有办法做到这一点吗?或者我应该在每个单独的线程(并建立单独的连接)中初始化 MYSQL 结构以执行查询?

0 投票
2 回答
2745 浏览

mysql - Slow simple single insert in MariaDB (MySQL) - 50 ms

MariaDB could be thought as a fork of MySQL

I have some software, written in C, which uses SQLite for some operations. I've implemented MySQL backend as an experiment to hasten DB performance. But surprisingly it was not too fast. Basically, I have a simple table:

There are no explicit foreign keys, no triggers on insert and so on. Then, the simple insert

takes 50 ms to complete. It is very slow for me, and it means only 20 inserts in second - is this OK? Unfortunately, those inserts are non-relating with each other, and it is not easy to group them with bulk inserts or transactions.

Am I miss something, and those inserts should be much faster? Or it is the expected performance (isn't it very slow)?

For this test, I run both the software and MariaDB 10.0 on the same machine - Core i7 and Debian x64. DB was set up with all defaults. DB type is XtraDB (InnoDB).

I'm not expert with MySQL

I've found a related question: mysql insert was too slow

0 投票
2 回答
37033 浏览

php - PDO 和 MariaDB

我在 PHP 中使用 PDO 已经有一段时间了,现在正在使用 MySQL。

然而,最近的发展让我认为 MySQL 将开始逐渐淡出以取代 MariaDB,尤其是在 MariaDB 之后:

  • 认为自己比 MySQL 早了许多开发人员年,而没有将新的开发投入付费领域(例如集群)。
  • 在甲骨文接管之后,大多数主要的 MySQL 开发人员都转向了 MariaDB。
  • 正在成为在各种 Linux 发行版上取代 MySQL 的默认数据库。
  • 是 MySQL 替代品的下降,大公司开始采用 MariaDB,例如 Wikipedia(在此处阅读博客文章)。

所以我的问题是,因为 MariaDB 似乎没有在 PDO 驱动程序中列出,并且认为 MariaDB 被设计为“替代品”,并且可能在未来逐步淘汰 MySQL。

我是否可以将 MySQL PDO 驱动程序与 MariaDB 数据库一起使用,至少在官方 MariaDB 驱动程序可用之前?

链接

0 投票
8 回答
32105 浏览

ubuntu - 安装 MariaDB - 未满足的依赖项,mariadb-server-5.5

我正在尝试在 Ubuntu 12.04 LTS 上安装 MariaDB。

我已按照https://askubuntu.com/questions/64772/how-to-install-mariadb和 MariaDB.org 提供的说明进行操作,这些说明会在您选择下载时出现。

最后一步是sudo apt-get install mariadb-server返回:

依赖问题是一个确认问题(https://mariadb.atlassian.net/browse/MDEV-3882),但我相信损坏的包阻止我解决这个问题。

如果我尝试安装 libmariadbclient18,我会得到以下信息:

我尝试使用 纠正损坏的包sudo apt-get install -f,但我仍然无法安装 mariadb-server 或 libmariadbclient18。

0 投票
0 回答
1697 浏览

mysql - MySQL 版本之间的导出/导入问题

我试图在导入前 11 个表后导入由5.5.25-MariaDB-mariadb1into生成的 SQL 文件5.1.55-rel12.6 - (Percona Server (GPL), 12.6 , Revision 200),导入过程因以下错误而中断:-

第 35252 行包含以下内容:-

谁能建议正确的语法可能是什么?我一直无法找到错误消息中提到的文档。

0 投票
2 回答
1217 浏览

mysql - 在数据库中创建多个相同类型的表(MySQL/MariaDB)

我试图找到一种在数据库中创建多个表的快速方法。这是我尝试过的。

显然这是不正确的语法。有任何想法吗?

0 投票
1 回答
159 浏览

php - ON DUPLICATE KEY UPDATE-like behaviour on multiple columns

I have a table like this:

Each user is permitted to vote a comment once. The value can be between -1 and 1. Is there a easy way for a table model to achieve an change of this vote in one single query, without checking EXISTS() first? I already thought about a hash-column like this

but is there any better solution for this?

0 投票
7 回答
20486 浏览

mysql - 在我的 Rails 项目中使用 MariaDB 而不是 MySQL

如何在我的 Rails 项目中使用 MariaDB 而不是 MySQL?

当我尝试安装 mysql2 gem 时返回错误,因为找不到 mysqlclient。

这里有一些解决方案,但我没有在我的 openSUSE 12.3 上找到任何libmariadbd-dev包。

0 投票
1 回答
3110 浏览

php - 我无法使用我的 PHP 脚本插入 MariaDB 表

我最近搬到了 MariaDB,因为自 MySQL 5.6 以来它对我来说已经失败了很多。

MariaDB 工作完美,但在一个新项目中,我无法使用 PHP 脚本将数据插入数据库。我只能手动插入。我没有对使用 MySQL 的脚本进行任何更改。

INSERT 语句是:

应该插入的脚本是:

“参与者”函数返回要使用的数据,没有问题。一切都在一个 try/catch 块内,它不会报告任何异常。

我的 PDO 课程如下:

使用 controller->insert 给我:

如有必要,我可以在 pastebin 上发布代码,请问。