问题标签 [mariadb-10.4]
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.
python - Error in SQL INSERT INTO statement in Python script
I'm an Mechanical Engineer with a little experience in C and C++ languages and no experience in Python or SQL labguages.
Recently, I started to work on stock prices analyses in order to optimise my portfolio. I started with an Excel file and several VBA macros. It works quite good but is very slow. So, I'm now trying to step up and set up a proper "stock prices" database on my server (based on this post).
In the "stock_prices" database, there is an 'exchange' table that stores all the markets identification codes (MIC) and related information. In order to update the exchange table, a python script will be launched once a month and it includes the below Python / SQL statements.
Unfortunately, the "Insert INTO" statement returns an error : 1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1"
I have read several posts on this error (which seems quite common) and have tried the following modifications that all returned the same error:
I have also tried this modification :
with a slightly different result : 1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''country', 'iso_country_code', 'mic', 'operating_mic', 'mic_type', 'name', 'acro' at line 1"
However, I don't see anything special near 'country'.
Could anybody suggest modifications to the "INSERT INTO" statement that I could try ?
Best Regards,
Edit 31/03/2020 : Statement after correction
mariadb - 我如何解决这个问题“systemctl start mariadb”
我正面临这个错误
root@localhost:~# systemctl start mariadb 用于 mariadb.service 的作业失败,因为控制进程以错误代码退出。
有关详细信息,请参阅“systemctl status mariadb.service”和“journalctl -xe”。
sql - 具有多个列和 LIMIT 2 的 GROUP BY?
我的 mysql 数据库中有以下数据结构:
我想收到每种颜色和每种品牌一个大尺寸和一个小尺寸行 - 像这样:
我的 SQL:
每种颜色都有一个小品牌和一个大品牌,我的 SQL 看起来像什么?
python - Error "'Timestamp' object has no attribute 'translate'"
Recently, I started to work on stock prices analyses in order to optimise my portfolio. I started with an Excel file and several VBA macros. It works quite well but is very slow. So, I'm now trying to step up and set up a proper "stock prices" database on my server (based on this post).
In the "stock_prices" database, there is a "daily_price" table that stores the daily stock prices for some tickers. In order to update the "daily price" table, a python script will be launched every day and it includes the below Python / SQL statements.
Unfortunately, the "cursor.execute..." line returns the below error : "AttributeError: 'Timestamp' object has no attribute 'translate'"
The print out of the "values" tuple is : [1, 2, Timestamp('2004-08-19 00:00:00'), 49.81328582763672, 51.83570861816406, 47.80083084106445, 49.9826545715332, 49.9826545715332, 44871300]
Based on what I could read in another similar post, I checked the type of the date index to make sure that it is not an object :
This returns "datetime64[ns]" which seems good.
Finally, in the database, I have tried to change the data type from "Date" to "Datetime", but this doesn't solve the error.
Could anybody share some hints about how to resolve this error ?
Best Regards,
Edit on 25/04/2020 : Final solution
exception - 如何使用 JDBC 区分不正确的登录凭据和服务器不可用
我正在编写一个程序来通过 JDBC 连接到 MariaDB 数据库。使用正确的凭据(用户名/密码),它可以正常连接。但是我试图在它没有连接时产生适当的错误消息,这就是我遇到问题的地方。无论问题是服务器不可用(停止)还是凭据不正确,我都会遇到相同的异常。
在这两种情况下,它都给出:
因此,我无法向我的用户解释他们是否需要重新输入密码或联系 IT,因为服务器已关闭,因为我无法区分这两者。
SQL 状态告诉我它可能是语法错误或访问规则违规。我在“-1”的错误代码上找不到任何内容。
我怎样才能在这里做出这种区分?
编辑
我以前不必制作最小可重现的例子,所以希望这很接近。
这是一个 JavaFX FXML 项目,这是登录屏幕的控制器。您会看到我在哪里测试凭据和底部的连接,此外我还评论了catch
我正在努力解决的特定部分。
这是数据源类:
这些分别是使用不正确的登录详细信息和无法联系的服务器返回的堆栈跟踪。
注意:因为这是一项正在进行的工作,所以这里混合了不同的异常处理样式。一旦事情正常工作,它们将被修复。
hibernate - Hibernate 无法实例化 ID 生成器
环境:Spring Boot 2.2.6 启动
器:spring-boot-starter-data-jpa、*-thymeleaf、*-web、*-tomcat、*-test
其他依赖:mariadb-java-client 2.6.0、spring-boot- devtools (MANAGED), lombok (MANAGED)
DB MariaDB: 10.4
Hibernate Dialect: MARIADB103
Using Internal Container for testing vs. Tomcat
关键错误是 Hibernate 无法实例化 id 生成器,这是控制台日志:
这是我的实体
说 Maria 不支持序列的明显重复已经过时,因为 MariaDB103 方言的声明更改之一是序列支持。
我还看到一些类似的问题询问自定义生成器,但我无法从他们那里收集到问题。我能够使用 IDENTITY 和自动编号使其工作,但我想尝试 SEQUENCE,但无法弄清楚秘密咒语。这里缺少什么?
sql - 反向Mysql查询
我有两个看起来像这样的数据库:
我想用 idUser、idClient、idSubclient 创建反向递归查询,如果元素的父级是运动则返回。
例如:
在我的情况下,具有 id 的 User2004
被分配给2
元素是 sport,但也被分配给 element 9
。带有 id 的元素9
是一个挂在带有 id 的类别上的团队,7
在这种情况下它不是一项运动,那么我需要咨询他的父母以检查是否是运动......
我的期望
| id元素 | |-----------| | 2 | | 4 |
java - 使用 MariaDB 10.4 和 eclipselink 的 java @GeneratedValue (strategy = GenerationType.IDENTITY) 问题
我正在使用 Java EE 开发 REST Web 服务:Glassfish 5.0 (build 25)、MariaDB 10.4 和 eclipselink (JPA 2.1) 这是我的代码:
commande_line 表
持久性.xml
命令行实体
命令行网络服务
抽象立面
问题是当我使用 Postman 测试我的 Web 服务并尝试使用 POST 请求插入记录时,我收到的错误消息是:
当我使用@GeneratedValue (strategy = GenerationType.IDENTITY) 时,我不明白为什么 SEQUANCE 会出现问题。当我使用 @GeneratedValue (strategy = GenerationType.SEQUENCE) 进行更改并使用以下脚本创建表时:
通过应用中所示的解决方案:表'customerjpa.sequence'不存在JPA 但同样的问题
预先感谢您的帮助。
mamp - 登录无效,请安装boost学习主题后在moodle E-learning重试
在 Moodle 中安装了 boost 学习主题后,我遇到了无效的登录,请重试