2017-11-10 15 views
-1

もう一度あなたの助けが必要です。 私は自分のJava Webサイトをオンラインにしようとしています。エラーウェブサイトでクエリを作成しようとしたときに 'クエリ用パケットが大きすぎます'

私が使用してどのような

  • MySQLサーバー:コマンドラインのmysql -V、結果:readlineのを使用して、Debian-のlinux-gnuの(x86_64版)用のMySQL版15.1按分10.1.23、MariaDB、 5.2
  • カイエン
  • のDebianサーバー
  • のJava(Vaadin)

照会用パケットが大きすぎます(4739923> 1048576)。 max_allowed_pa​​cket '変数を設定することにより、サーバー上のこの値を の値に変更することができます。

私が試した何

1.エラーが言ったように、私は実行して、サーバー上の値を変更しようとしました:

  • ログを自分のサーバー
  • にでMySQLに接続します。mysql -u root
  • 入力します。SET GLOBAL max_allowed_packet=1073741824;
  • 、その後、使用してサーバーを再起動します。/etc/init.d/mysql restart

しかし、私はまだエラーが発生しています。

2.私は見ていた:How to change max_allowed_packet size

しかし、私はnano /etc/mysql/my.cnfをしたときは、ファイルが(私は[mysqlの]はありません)のようになります。

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
permitted by applicable law. 
Last login: Fri Nov 10 23:57:02 2017 from 82.236.220.195 
[email protected]:~# nano /etc/mysql/my.cnf 
    GNU nano 2.7.4    File: /etc/mysql/my.cnf    Modified 

# One can use all long options that the program supports. 
# Run program with --help to get a list of available options and with 
# --print-defaults to see which it would actually understand and use. 

# 
# This group is read both both by the client and the server 
# use it for options that affect everything 
# 
[client-server] 
# The MariaDB configuration file 
# 
# The MariaDB/MySQL tools read configuration files in the following order: 
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults, 
# 2. "/etc/mysql/conf.d/*.cnf" to set global options. 
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options. 
# 4. "~/.my.cnf" to set user-specific options. 
# 
# If the same option is defined multiple times, the last one will apply. 
# 
# One can use all long options that the program supports. 
# Run program with --help to get a list of available options and with 
# --print-defaults to see which it would actually understand and use. 

# 
# This group is read both both by the client and the server 
# use it for options that affect everything 
# 
[client-server] 

# Import all .cnf files from configuration directory 
!includedir /etc/mysql/conf.d/ 
!includedir /etc/mysql/mariadb.conf.d/ 

MySQLでは、フォルダ/ 'mysqlの' フォルダ内のファイルは以下のとおりです。

enter image description here

ヒントは非常に感謝されます!

EDIT ありがとう:

  1. max_allowed_packet = 1073741824
  2. max_connections = 100000

をし、私がコメントを追加しました::/etc/mysql/mariadb.conf.d/50-server.cnfは、私が変更net_buffer_length = 1048576

を見るために:私のワークベンチで 、 ICエラーが明示的ではなかったので

MariaDB [(none)]> SELECT @@global.max_allowed_packet; 
+-----------------------------+ 
| @@global.max_allowed_packet | 
+-----------------------------+ 
|     1073741824 | 
+-----------------------------+ 
1 row in set (0.00 sec) 

ソリューションを:参照サーバー変数: enter image description here

EDIT2:私は、サーバー上のコマンドラインで変数を選択すると今、私が持っています。 com.mysql.jdbc.PacketTooBigException

マイカイエン構成に

感謝した

<url value="jdbc:mysql://IPADDRESS:22/DBBASENAME" /> 
<login userName="ServerUserName" password="ServerPassword" /> 

しかし、それは次のようになります。my.cnf

<url value="jdbc:mysql://IPADDRESS/DBBASENAME" /> 
<login userName="MYSQLUserName" password="MYSQLPassword" /> 

答えて

0

変更は、その後、mysqldを再起動します。

はいっそのこと、/etc/mysql/mariadb.conf.d/下のファイルに入れて、セクションを指定:あなたが再起動したときに、あなたが何をしたか

[mysqld] 
max_allowed_packet = 1073741824 

SET)が去っていきましたが。それでも、それはSETを実行した後にログインした接続にのみ適用されます。

+0

こんにちは@Rick James、ありがとうございました。しかし、私はあなたが言ったことをしたと思います。あなたの最初のポイントは: 'my.cnf'で変更してみましたが、私は言ったように、私は[mysqld]を持っていません、あなたが 'my.cnf'に書き込んだのと同じ行を入れて、成功なし。そして、あなたは '/ ect/mysql/mariadb.conf.d'の下にファイルを置くと言っています。私が投稿したように、' 50-server.cnf'を編集します。私は新しいファイルを作成すべきですか? 「はい」の場合、ファイル名はどのようにする必要がありますか?ありがとう – Bob

+0

'... d'はディレクトリであると仮定し、あなたが好きなファイル名(私は頭文字+' .cnf'を使います)を作成し、その2行を入れます。 '50-server.cnf'はうまくいくはずです。 –

+0

not working :(。私が新しいbob.cnfに入れたとき、私は変更がありませんでした(私はまだエラーがあります)。これは非常に奇妙ですね? – Bob

関連する問題