问题标签 [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 投票
1 回答
12339 浏览

php - How to replace MySql with MariaDb in WAMP?

I have a Wamp server installed on Windows and it works perfectly. This article at the Slashdot inspired me to migrate from MySql to MariaDb and this question states that I can uninstall mysql and install MariaDb and it will work fine. However on Windows "Uninstall programs" section at control panel doesn't list something like MySql, i have only WampServer 2.2. Consequently, how can i replace MariDb with MySql on Windows or do i have to install php, apache, mariadb seperately?

0 投票
1 回答
725 浏览

mariadb - 多个文件表 MariaDB

我在 CentOS 6.4 上运行 MariaDB (10.0.2-MariaDB),并想使用 MariaDB 的 CONNECT-Engine 从一些日志文件中读取。由于日志文件很大,我用两个 CSV 文件重新创建了错误,每个文件都包含一行。

现在有趣的功能是将这些文件合并到一个表中,这应该是可能的(说https://kb.askmonty.org/en/connect-table-types-data-files/#multiple-file-tables)。

但如果我这样做:

有人知道解释吗?没关系“compress = 0”,我还测试了从 gzip 压缩文件中读取,这就像一个魅力......直到你尝试从两个文件中读取到一个表中。

谢谢, 詹斯

0 投票
2 回答
3424 浏览

mysql - 如何更改 INFORMATION_SCHEMA 或添加触发器或外键?

我正在尝试创建一些元数据来扩展 mysql 功能,但我无法在数据库 INFORMATION_SCHEMA 中创建表。我认为我可以创建另一个数据库并在其中保存我的元数据,但我需要一些外键从我的表到 INFORMATION_SCHEMA 数据库中的一些表。不过,我在尝试创建它们时会出错。然后我想我可以创建一个触发器来获得更改通知,但是由于触发器与表相关联并且我无法更改该数据库,因此我也无法创建触发器。

具体来说,我有一些表引用information_schema.schemata(schema_name)和引用以及其他一些表information_schema.schemata(columns)。我想拥有那些外键,这样我就可以使用ON UPDATE CASCADE ON DELETE CASCADE,否则我的表中会有一些行没有引用,我不能允许这样做。

我正在使用使用 MySql 5.3 的 mariaDB 5.5.30。

0 投票
1 回答
71 浏览

mysql - 从连接返回表中的最新行

我有两张桌子。考虑一下表 A 和表 B。

表A中有一个列表。

表 B可能有指向表 A中事物的条目。

也就是说,对于表 A 中的每一行,表 B 中可能有 0 行或n行链接回它(通过表 B 中的一些 ID 列)。

我想要做的是使用某种 JOIN 运行 1 SELECT 语句,它返回表 A 中的所有行(所有列)和表 B 中的 1 列的列表,其中表 B 中的 1 列按 DESC 排序(列是时间戳,我想要最近的时间戳)。

也就是说,我希望我的 SELECT 语句为表 A 中的每一行返回 1 行。结果集中的一列将是表 B 中的数据,它必须从对应于的最新条目中获取数据表 A 行。

我真的不知道如何做到这一点。我什至尝试将“TableB.created_on = max(TableB.created_on)”添加到 JOIN 的 ON 子句中。

0 投票
1 回答
1437 浏览

mysql - MariaDB 5.5 Installation on top of MySQL

I am trying to use MariaDB instead of MySQL on my windows 7 desktop. Below are the steps I have done so far.

  1. I have previously MySQL installed in my PC.
  2. I have not uninstalled that MySQL.
  3. Downloaded mariadb-5.5.30-win32.msi from mariadb.org
  4. installed mariadb-5.5 but while installing it asked me to change the service name(by default it was showing service name as MySQL and port number as 3306) as I have MySQL installed with the same service name & port no. So I changed the service name as MariaDB & port as 3305.

Now when connecting from HediSQL by port no: 3305 and localhost I am able to connect to MariaDB and it is showing the 4 default databases as same as MySQL i.e. information_schema, mysql ,performance_schema, and test.

Same way I can connect from HediSQL by port no: 3306(i.e. the default port no of my previously installed MySQL), I am able to connect to my old MySQL and showed my other application databases.

Till now it is absolutely fine.

But how to connect the MariaDB from command line like I used to connect for MySQL using the below command: mysql -uroot -proot i.e. the MySQL client.

and also I can see that in MariaDB 5.5/bin all .exe files (except some extra .exe files) are as same as MySQL/bin. Is it using the same MySQL server internally. if yes then why I need to install MariaDB separately?

Now To use MariaDB shall I need to import my application DB from MySQL to MariaDB?

I am really confused between these two DB. Please help.

Regards, Sandip

0 投票
1 回答
103 浏览

mysql - MySQL/Maria 构建视图匹配缩写到完整描述

首先,我不控制我正在管理的数据。它来自电子表格中的客户,我正在尽我所能。我实际上是在处理一团乱麻,并尽我所能将其正常化。

我正在使用 MariaDB 5.5.30,InnoDB 表格式。

我的一个项目要求要求在搜索结果中显示由“标准”缩写(至少在他们公司内部)组成的项目描述。用户可能不知道所有的缩写定义,所以他们最初的想法是一个单独的搜索框来查找一个缩写。相反,我想让用户悬停/单击内联缩写并查看定义的工具提示。

我知道这将涉及某种将描述中的缩写与缩写表匹配以获取定义的视图。我也知道这可能产生的开销。

我正在寻找一种相对有效的方法(视图、例程等)的建议。即使这意味着构建一个静态表,将项目与提供定义的记录联系起来......

缩写词几乎可以任何组合出现在项目描述中。只有与缩写匹配的描述片段才会有工具提示。不幸的是,一些缩写是多个单词,而另一些缩写则少于 4 个字符。

如果这样做会对性能造成痛苦,我愿意回到他们最初的想法。但是为了统一界面,我认为这会很好。

任何(建设性的)建议表示赞赏。

0 投票
1 回答
567 浏览

sql - 选择所有子记录但需要父母或祖父母记录的值

我正在开发一个项目,该项目使用 MariaDB v5.5 数据库来跟踪基于树的更高层次中的员工。这棵树中的每个人都可以有各种与之相关的“标志”。在这种情况下,这些标志使用位掩码存储。

我的对象如下所示

假设我想查询所有具有“MAINTANCE”标志的员工,但我需要返回具有“MANAGER”标志的父记录的 id。所以我的结果应该是这样的。

那么如何构建我的查询来给我想要的东西呢?

请注意,这棵树的深度可能不止 3 层,而且查询仍然需要工作。

0 投票
1 回答
2535 浏览

mysql - SUM 列和 GROUP BY 日期 MySQL (MariaDB)

这是我的数据库的一个例子(巨大的数据库,一个表)。我正在使用 MariaDB。

我正在尝试按日期对 SIZE 列和 FILES 列求和。例如,对于 2013-01-06,大小为 4800,文件为 44,依此类推。我试过的查询是

...但它只给出总数。

0 投票
1 回答
50 浏览

nginx - 我可以使用任何未设置的用户访问 MariaDB

我有一个大问题。当我以 root 身份进入我的服务器并输入:

注意用户 test_user 不存在,我什至可以在没有密码的情况下进入 MariaDB。

我可以做些什么来配置没有任何用户可以访问的 mariadb 中的安全性?

0 投票
1 回答
6885 浏览

mysql - 如何在 CentOS 6 中为 MariaDB Galera 集群配置多主复制

我一直在搜索有关如何在 MariaDB 中配置多主复制的文档,但我找不到任何文档。我曾经尝试过一些 MySQL 配置,但它们没有用。Wsrep 在我的两个节点中都处于打开状态,但是当我将第二个节点连接到施主时,重新启动 mysql 时出现错误。我正在使用 CentOS 6.4 操作系统。有人可以提供 MariaDB-Galera 集群多主复制的文档吗?