我在 MariaDB 中运行此选择,它按预期工作,它只是一个带有以下内容的选择exists:
select * from pred_loan_defaults d
where exists (select 1 from pred_loan_defaults d2
where d.exec_id = d2.exec_id and d.loan_identifier = d2.loan_identifier
and d2.default_status = 1 and d.prediction_date > d2.prediction_date)
order by loan_identifier, prediction_date
Run Code Online (Sandbox Code Playgroud)
现在,我尝试删除所选的行,因此我调整了语句:
delete from pred_loan_defaults d
where exists (select * from pred_loan_defaults d2
where d.exec_id = d2.exec_id and d.loan_identifier = d2.loan_identifier
and d2.default_status = 1 and d.prediction_date > d2.prediction_date);
Run Code Online (Sandbox Code Playgroud)
但我收到一个错误:
SQL 错误 [1064] [42000]: (conn=6) 您的 SQL 语法有错误;检查与您的 MariaDB 服务器版本相对应的手册,了解使用近 'd 的正确语法
该声明有什么问题吗delete …
我们公司有一个基于 php 5.6 和 mysql 构建的相当旧的应用程序。我们最近决定进行一些更改并更改其托管位置。虽然迁移过程有点痛苦,但大部分进展顺利。
新的主机提供商使用 MariaDB 而不是 MySQL。整个应用程序运行良好,除了一部分。这部分基本上是从数据库访问配置文件数据。当我们点击“我的个人资料”时,出现以下错误 -
您的 SQL 语法有错误;检查与您的 MariaDB 服务器版本相对应的手册,了解在第 1 行“offset asc, gmt asc”附近使用的正确语法。
我们不知道需要什么版本的 MariaDB,因为无法判断。当我们使用 MySQL 时,一切都运行良好。
任何反馈将不胜感激。TIA。
我们不确定从哪里开始,因为 php 代码没有列出任何对 MariaDB 版本的引用。
我有一个cpanel服务器,我试图将MySQL升级到MariaDB 10,现在一切正常,除了许多使用unicode语言的Joomla 1.5网站现在显示问号而不是每个字符:
我必须澄清一些事情:在升级之前,站点正在使用MySQL 5.5正确显示,并且数据在数据库中完好无损,因此当我将站点复制到另一台MariaDB 5.6服务器时,它会正确显示.
我试过了:/etc/my.cnf.d/server.cnf
[mysqld]
collation-server=utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
Run Code Online (Sandbox Code Playgroud)
和/etc/my.cnf.d/mysql-clients.cnf
[mysql]
default-character-set=utf8
Run Code Online (Sandbox Code Playgroud)
在joomla系统信息中,我得到:
数据库整理:N/A(mySQL <4.1.2)
没运气
以下代码向我抛出异常,通过使用 mariadb 管理器,这与 mysql 未通过,允许我执行 executeUpdate,但不能执行 executeQuery。我寻求解决方案的真相,没有一个是我的情况,因为我没有犯任何这些错误。已经重装了java和mariadb,还是不行。谢谢!
这是我的代码:
package Conexion;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class mainPruebas {
public static void main(String[] args)
{
String url = "jdbc:mariadb://127.0.0.1:3306/buscadorpersonas?autoReconnect=true&useSSL=false";
String user = "root";
String pass = "2222";
Connection conexion=null;
PreparedStatement ps=null;
try {
conexion = DriverManager.getConnection(url,user,pass);
ps = conexion.prepareStatement("SELECT CODIGOCLIENTE, EMPRESA, POBLACION FROM tclientes WHERE POBLACION='?';");
ps.setString(1, "MADRID");
ResultSet rs = ps.executeQuery();
while(rs.next()) {
System.out.println(rs.getString("CODIGOCLIENTE")+" "+rs.getString("EMPRESA")+" "+rs.getString("POBLACION"));
}
conexion.close();
}catch(Exception e) {
e.printStackTrace();
}
}
}
Run Code Online (Sandbox Code Playgroud)
例外: …
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| admin_default |
| information_schema |
| mysql |
| openvpn-admin |
| performance_schema |
| roundcube |
+--------------------+
6 rows in set (0.00 sec)
MariaDB [(none)]> drop database 'openvpn-admin';
ERROR 1064 (42000): 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 ''openvpn-admin'' at line 1
MariaDB [(none)]> drop database openvpn-admin;
ERROR 1064 (42000): You …Run Code Online (Sandbox Code Playgroud)