有没有办法从 mysql 控制台知道 bin 日志文件路径,因为我们可以通过使用知道它是打开还是关闭
Select * information_schema.GLOBAL_VARIABLES
where variable_name like '%log_bin%'.
Run Code Online (Sandbox Code Playgroud) 我尝试使用以下代码为文件生成 base64 并作为字符串返回。如果文件大小很小,我能够得到。
StringBuffer output = new StringBuffer();
Process p;
try {
p = Runtime.getRuntime().exec(command);
p.waitFor();
BufferedReader reader =
new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = reader.readLine())!= null) {
output.append(line + "\n");
}
} catch (Exception e) {
e.printStackTrace();
}
return output.toString();
Run Code Online (Sandbox Code Playgroud)
如果有任何其他方法可以获取文件的base64。我传递的命令是base64 文件名。请让我知道