错误#1238更新DateTime格式变量时

发布于 2025-02-11 02:48:03 字数 397 浏览 0 评论 0原文

我正在尝试更改 mysql 全局变量datetime_format使用Zulu Time(%y-%m-%m-%dt%H:%i:%i:%sz < /代码>)在我的应用程序中。

我以前从来没有任何问题在Localhost上运行此命令,并且在没有收到此错误的情况下找不到方法:

##1238-变量'dateTime_format'是读取变量

我可以访问my.cnf file,但这不允许我为启动设置任何默认变量。

在启动 mysql 时,我是否可以绕过此方法和/或设置默认变量,或者我必须找到替代的本地服务器?

I'm attempting to change the MySQL global variable datetime_format to use zulu time (%Y-%m-%dT%H:%i:%sZ) inside my application.

I've never had any issues running this command on localhost before and I cannot find a way to do it without receiving this error:

#1238 - Variable 'datetime_format' is a read only variable

On MAMP Pro I have access to the my.cnf file, but this doesn't let me set any default variables for startup.

Is there a way I can bypass this and/or set default variables when starting up MySQL or will I have to find an alternative local server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自演自醉 2025-02-18 02:48:03

要设置DateTime格式,您需要在my.cnf文件中添加它。

在MAMP中,您需要遵循以下步骤:

  1. 停止服务器
  2. 在/applications/mamp/conf/conf/conf/conf/添加
  3. 您的内容中添加到my.cnf
  4. 保存my.cnf
  5. 开始服务器

To set datetime format, you need to add it inside your my.cnf file.

In MAMP you need to follow below steps:

  1. Stop servers
  2. Create a my.cnf file in /Applications/MAMP/conf/
  3. Add your content in to my.cnf
  4. Save my.cnf
  5. Start servers
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文