MAMP 中包含的 MySQL 是否不包含配置文件?

发布于 2024-07-15 03:51:44 字数 133 浏览 3 评论 0原文

我似乎找不到 MAMP< 附带的 MySQL 的 my.cnf 或其他配置文件/a>. 其中不包括一项吗?

I can't seem to find the my.cnf or other config file for the MySQL that comes with MAMP. Does it not include one?

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

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

发布评论

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

评论(6

萌化 2024-07-22 03:51:44

MAMP(非 PRO)的 MySQL 服务器将在没有任何 my.cnf 文件的情况下启动。 但您可以创建自己的 my.cnf 文件。

  1. 停止服务器
  2. /Applications/MAMP/conf/ 中创建 my.cnf 文件
  3. 将您的内容添加到 my.cnf
  4. 保存 my .cnf
  5. 启动服务器

您不必将完整的配置放入 my.cnf 文件中。 您可以只添加部分配置...例如:

[mysqld]
max_allowed_packet = 64M

The MySQL server of MAMP (not PRO) will be started without any my.cnf file. But you can create your own my.cnf file.

  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

You do not have to put a complete configuration in the my.cnf file. You can just add parts of a configuration ... for example:

[mysqld]
max_allowed_packet = 64M
不离久伴 2024-07-22 03:51:44

找到

一些标准的 my.cnf 变体可以在 /Applications/MAMP/Library/support-files/中 MAMP mysqld 二进制报告上的 less:

默认选项按给定顺序从以下文件中读取:
/etc/my.cnf /etc/mysql/my.cnf /Applications/MAMP/conf/my.cnf ~/.my.cnf

将 /Applications/MAMP/Library/support-files/ 中的变体之一复制到以下之一上面 mysqld 搜索顺序中的位置,重新启动守护进程后应该就可以了。

Some standard my.cnf variants can be found at /Applications/MAMP/Library/support-files/

Invoking mysqld --verbose --help | less on the MAMP mysqld binary reports:

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /Applications/MAMP/conf/my.cnf ~/.my.cnf

Copy one of the variants in /Applications/MAMP/Library/support-files/ to one of the locations in mysqld's search order above, and you should be good to go after restarting the daemon.

诗酒趁年少 2024-07-22 03:51:44

由于 MAMP 服务器在 MAMP 服务器启动时动态生成 my.cnf,因此最好使用以下步骤添加或编辑 MySQL 配置:

  1. 停止 MAMP 服务器
  2. 转到文件 > > 编辑模板> MySQL
  3. 进行必要的更改并保存
  4. 重新启动 MAMP

我在 MAMP PRO 3.5 上尝试过此操作。

Since MAMP server generates my.cnf dynamically on MAMP server startup, it's best to use the following steps to add or edit the MySQL configuration:

  1. Stop MAMP server
  2. Goto Files > Edit Template > MySQL
  3. Make the necessary changes and save
  4. Restart MAMP

I tried this on MAMP PRO 3.5.

习惯成性 2024-07-22 03:51:44

对于 Mac El Capitan 上的 MAMP 3.5,只有这个对我有用:

  1. 停止服务器
  2. /Applications/MAMP/Library/ 中创建一个 my.cnf 文件
  3. 添加您的内容进入 my.cnf 就像

    <代码>[mysqld]
    max_allowed_pa​​cket = 64M

  4. 保存my.cnf

  5. 启动服务器

不需要更改文件的所有权,它应该可以工作。 通过在 phpmyadmin 中运行 SHOW VARIABLES 进行验证并查找更改的设置。

For MAMP 3.5 on Mac El Capitan, only this worked for me:

  1. Stop servers
  2. Create a my.cnf file in /Applications/MAMP/Library/
  3. Add your content into my.cnf like

    [mysqld]
    max_allowed_packet = 64M

  4. Save my.cnf

  5. Start servers

Not required to change ownership of file, it should work. Verify by running SHOW VARIABLES in phpmyadmin and look for your changed setting.

鯉魚旗 2024-07-22 03:51:44

不,它不附带 my.cnf 文件

No, it doesn't come with the my.cnf file

洒一地阳光 2024-07-22 03:51:44

我发现如果未提供 ~/my.cnf,MAMP PRO 将在启动时默认在 MAMP/tmp 目录下创建 my.cnf ... grep ps aux 您可能会在 /Applications/MAMP/tmp 下找到默认位置/my.cnf ...

 ps aux | grep mysql

其中提供了以下内容...

root       284   0.0  0.1  2435544    532   ??  Ss    12:00AM   0:00.06 /bin/sh     /Applications/MAMP/Library/bin/mysqld_safe 
--defaults-file=/Applications/MAMP/tmp/mysql/my.cnf 
--port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock 
--user=mysql --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid 
--log-error=/Applications/MAMP/logs/mysql_error_log.err 
--tmpdir=/Applications/MAMP/tmp/mysql/tmpdir 
--datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql

I found that MAMP PRO will create a my.cnf by default on startup under the MAMP/tmp directory if a ~/my.cnf is not provided ... grepping ps aux you may find the default location under /Applications/MAMP/tmp/my.cnf ...

 ps aux | grep mysql

Which provided the following...

root       284   0.0  0.1  2435544    532   ??  Ss    12:00AM   0:00.06 /bin/sh     /Applications/MAMP/Library/bin/mysqld_safe 
--defaults-file=/Applications/MAMP/tmp/mysql/my.cnf 
--port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock 
--user=mysql --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid 
--log-error=/Applications/MAMP/logs/mysql_error_log.err 
--tmpdir=/Applications/MAMP/tmp/mysql/tmpdir 
--datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文