CONTENTS


Lastmodified 2019-05-08 (水) 06:00:48


mysql バージョンアップ

mysql56はメンテ終了なので、取り敢えず57へUPする。なお、mysql56は稼働させたまま作業する。

# pkg delete mysql56-server-5.6.44
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        mysql56-server-5.6.44

Number of packages to be removed: 1

The operation will free 82 MiB.

Proceed with deinstalling packages? [y/N]:

とサーバは、単独でdelete できるが、クライアントは、依存関係が多々あって、port deinstall するのがヨサゲ。

# pkg delete mysql56-client-5.6.44
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 11 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
       mysql56-client-5.6.44
       apr-1.6.5.1.6.1_1
       p5-DBD-mysql-4.050
       postfix-3.4.5,1
       mysql56-server-5.6.44
       apache24-2.4.39
       spamassassin-3.4.2_3
       ja-mailman-2.1.14.j7_6,1
       ap24-mod_http2-devel-1.11.4
       mod_php71-7.1.28_2
       amavisd-new-2.11.1_1,1

Number of packages to be removed: 11

The operation will free 199 MiB.

Proceed with deinstalling packages? [y/N]:

まず、pkg delete mysql56-server-5.6.44 する。

# portinstall mysql57-server
[Reading data from pkg(8) ... - 483 packages found - done]
** Port marked as IGNORE: databases/mysql57-server:
       cannot install: MySQL versions mismatch: mysql56-client is installed and wanted version is mysql57-client
** Listing the failed packages (-:ignored / *:skipped / !:failed)
       - databases/mysql57-server
# cd /usr/ports/databases/mysql56-client
# make deinstall
===>  Deinstalling for mysql56-client
===>   Deinstalling mysql56-client-5.6.44
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        mysql56-client-5.6.44

Number of packages to be removed: 1

The operation will free 38 MiB.
[1/1] Deinstalling mysql56-client-5.6.44...
[1/1] Deleting files for mysql56-client-5.6.44: 100%

以下を実行するとクライアントもインストールされる。

# portinstall mysql57-server
[Reading data from pkg(8) ... - 482 packages found - done]

以下の様なスクリプトを実行してアップグレードする。

#/bin/sh!
/usr/local/etc/rc.d/mysql-server restart && \
/usr/local/bin/mysql_upgrade -u root -pパスワード

実行すると・・・

                                     
mysql_upgrade: [Warning] Using a password on the command line interface can be insecure.
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
     :                 :
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Upgrading the sys schema.
Checking databases.
JM3.vg49r_assets                                   OK
JM3.vg49r_associations                             OK
     :                 :
phpmyadmin.pma__tracking                           OK
phpmyadmin.pma__userconfig                         OK
phpmyadmin.pma__usergroups                         OK
phpmyadmin.pma__users                              OK
sys.sys_config                                     OK
Upgrade process completed successfully.
Checking if update is needed.

となって移行完了。

# portinstall mysql57-server --batch &&  /root/bin/check.sh

===>  openldap-sasl-client-2.4.47 conflicts with installed package(s):
     openldap-client-2.4.47

     They install files into the same place.
     You may want to stop build with Ctrl + C.
===>  License OPENLDAP accepted by the user
===>   openldap-sasl-client-2.4.47 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by openldap-sasl-client-2.4.47 for building

===>  openldap-sasl-client-2.4.47 conflicts with installed package(s):
     openldap-client-2.4.47

     They will not build together.
     Please remove them first with pkg delete.
*** Error code 1
# pkg delete openldap-client-2.4.47
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 3 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
       openldap-client-2.4.47
       php71-ldap-7.1.28_2
       php71-extensions-1.0

Syntax error or access violation

ログには特にめぼしい情報がないので、これはSNSプログラム側の問題っぽい。

バックエンド_DEV形式でSNSを表示すると、こんなダイアログが・・・

Syntax error or access violation: 1055 Expression #124 of SELECT list is
not in GROUP BY clause and contains nonaggregated column 'カラム名'
which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by

などとなって、OpenPNEの「あしあと」でエラー。

https://www.p-nt.com/technicblog/archives/204

どうやら、MySQL5.7になって、デフォルトのままだとsql_modeでONLY_FULL_GROUP_BYが設定されるようになったため、一意にできていない場合にこのエラーになるそうです。

ちんと対応する方法としてはSQLをきちんと一意に特定できるように、GroupBy句に取得するカラムを指定したり、MAXやMIN、SUMなどで一意になるように修正する必要があるとのこと。

ただ、SQLを全て修正するには自分はスキル不足なので、MySQL側の設定で動作を確保する。

要するに、sql_modeで、ONLY_FULL_GROUP_BYを未指定にして、エラー発生回避して、SNS「あしあと」動作確保します。

具体的には、

sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

とする。

取り敢えずOK?


Total access 880:本日 1:昨日 0

Counter: 880, today: 1, yesterday: 0

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019-05-08 (水) 06:00:48