AWS Linux - 用于编辑数据包大小的MySQL cnf文件在哪里?

时间:2015-12-15 01:49:55

标签: mysql amazon-web-services

我收到override func viewDidLoad() { super.viewDidLoad() addBackButton() } func addBackButton() { let backButton = UIButton(type: .custom) backButton.setImage(UIImage(named: "BackButton.png"), for: .normal) // Image can be downloaded from here below link backButton.setTitle("Back", for: .normal) backButton.setTitleColor(backButton.tintColor, for: .normal) // You can change the TitleColor backButton.addTarget(self, action: #selector(self.backAction(_:)), for: .touchUpInside) self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: backButton) } @IBAction func backAction(_ sender: UIButton) { let _ = self.navigationController?.popViewController(animated: true) } 错误。我不太清楚为什么会这样,但经过一些研究后,大多数推荐的答案都涉及编辑cnf文件以增加数据包大小和其他设置。

问题是我无法找到此文件。它会在哪里?

我在MySQL server has gone away下找到了一个my.cnf文件,但其中包含的内容如下:

/etc

谢谢

1 个答案:

答案 0 :(得分:2)

您可以通过在config中设置变量来更改允许的最大数据包大小。

只需在max_allowed_packet=500M部分添加[mysqld]

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd

max_allowed_packet=500M

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

更新配置后,需要重启MySQL服务才能生效。

注意:变量的最大大小为1024 MB。