BLOGTIMES
» ArchiveList (Tag for "mysql / firefox" )
«Prev || 1 · 2 · 3 · 4 · 5 ·... | | Next»
2023/03/14

MariaDB が yum/dnf でアップデートできなくなっていたので

mysql  centos7  centos8  rockylinux9 

MariaDB は yum/dnf で自動的にアップデートされるようにしていたのですが、いつの間にか以下のようなエラーが出るようになってしまっていました。

warning: /var/cache/yum/x86_64/7/mariadb-main/packages/MariaDB-server-10.3.38-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID c74cd1d8: NOKEY The following updates will be applied on host.example.jp: ================================================================================ Package Arch Version Repository Size ================================================================================ Updating: MariaDB-client x86_64 10.3.38-1.el7.centos mariadb-main 11 M MariaDB-common x86_64 10.3.38-1.el7.centos mariadb-main 82 k MariaDB-compat x86_64 10.3.38-1.el7.centos mariadb-main 2.2 M MariaDB-server x86_64 10.3.38-1.el7.centos mariadb-main 25 M MariaDB-shared x86_64 10.3.38-1.el7.centos mariadb-main 113 k Transaction Summary ================================================================================ Upgrade 5 Packages Updates failed to install with the following error message: GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY"

どうやら GPG のキーが新しくなった*1ようで、エラーを解消するにはこれをインストールしてやる必要があります。
MariaDB の公式マニュアル通りに以下を実行することで大丈夫でした。

sudo rpm --import https://supplychain.mariadb.com/MariaDB-Server-GPG-KEY

at 21:31 |
2021/02/22

Dokcer で Redmine + MariaDB サーバを立ててみた

docker  redmine  mysql  dockercompose 

今度は Redmine + MariaDB を Docker 化していきます。

Redmine も MariaDB もどちらも公式のイメージを使います。

今回の Redmine は要件として

  • バージョンは 3.x 系統であること
  • パスは /redmine で参照できること

というのがあるので、この部分についてはカスタマイズを行っています。

ファイルを配置したら以下のコマンドで起動できます。

docker-compose up -d

起動ができたら http://hostname:3000/redmine/ でアクセスができるはずです。

マイグレーション

既存の環境からの DB のマイグレーションについては、docker-compose exec redmine-db bashで MariaDB のコンテナに入り、MariaDB にデータをインポートすれば良いと思います。ファイルについては ./data ディレクトリ以下に必要なファイルをコピーすれば OK です。

ファイル構成

docker-redmine-mariadb/  ├ docker-compose.yml  └ redmine/    └ Dockerfile


    at 22:55 |
    2020/11/05

    php + MariaDB で Malformed communication packet というエラーが出るときは

    mysql  php  centos7 

    今日は朝から php + MariaDB の環境で以下のエラーが発生して困ってしまいました。

    500 SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select * from ・・・・)

    Malformed communication packet というエラーは初めて見たかもしれません。

    MariaDB をダウングレードして暫定対処

    原因としては MariaDB のバージョンアップに起因するようなので、以下のように MariaDB をダウングレードして暫定対象しました。

    systemctl stop mariadb yum downgrade MariaDB-server MariaDB-common MariaDB-shared MariaDB-client MariaDB-compat MariaDB-devel --skip-broken yum --showduplicates search MariaDB-* yum install MariaDB-server-10.4.15-1.el7.centos.x86_64 MariaDB-client-10.4.15-1.el7.centos.x86_64 systemctl status mariadb systemctl enable mariadb

    同じ話題が Stack Overflow にも

    以下の Stack Overflow のエントリににもあるように、意外と同じところでハマった人は多いようです。
    これを見ると PHP 7.3 では発生しないという話も出ているので PHP 7.1 と最新版の Maria DB の問題みたいですね。


      at 12:58 |
      2020/02/26

      Firefox が米国で DoH(DNS over HTTPS) を有効に

      firefox  dns  cloudflare 
      Firefox DNS over HTTPS - Firefox が米国で DoH(DNS over HTTPS) を有効に

      Firefox が米国で DoH(DNS over HTTPS) を有効にしたことがニュースになっていたのでメモ。

      HTTP については 2016 年に始まった Let's Encrypt のおかげで急速に HTTPS 化が進みましたが、DNS の暗号化については DNS over TLS と DNS over HTTPS のどちらが良いか*1という解決が難しい問題もあり、すんなりとは行きそうにありません。

      今回の Firefox の場合、クエリは初期設定の場合 Cloudflare に飛んでいくことになるので、Cloudflare にはユーザーがどのサイトに接続しようとしているのかが丸見えであることに注意が必要です。

      Mozilla、「Firefox」の“DNS over HTTPS”をデフォルト有効化 ~米国で実施 - 窓の杜

      「Firefox」の“DoH”機能は、米国でのみ既定で有効。米国外のユーザーも、オプション画面(about:preferences)の[一般]セクション最下部にあるネットワーク設定へアクセスし、[DNS over HTTPS を有効にする]というオプションを有効化すれば利用できる。初期設定のプロバイダーは“Cloudflare”になっているが、“NextDNS”などを指定することも可能だ。


      at 22:54 |
      2019/10/29

      gem mysql から mysql2 に移行してみる

      ruby  mysql 

      昔書いた Ruby のプログラムを CentOS 7 上で動かそうとしたのですが、MariaDB が 10.4 と比較的新しいバージョンだったので gem で mysql がインストールできないので困ってしまいました。

      mysqlを見ると、最終アップデート日が 2013 年になっていて、最近はメンテナンスされていないようです。このまま粘っても解決の見込みも立たないので、mysql2 に移行してしまうことにしました。

      ソースの書き換えは大きく3箇所

      基本的には以下の3箇所を変更してやれば、基本的な動作はするようです。
      Date などの部分を自動的に cast する機能がついたようですが、これは :cast => false でオフにしてあります。

      # モジュールの読み込み require 'mysql' require 'mysql2' # 接続 @db = Mysql::connect('localhost', 'user_name', 'pass', 'db_name') @db = Mysql2::Client.new(:host => 'localhost', :username => 'user_name', :password=> 'pass', :database => 'db_name', :cast => false) # 結果の取得 rows.each_hash rows.each
      [gem mysql から mysql2 に移行してみる の続きを読む]

        at 22:24 |
        2019/10/20

        Mailvelope でウェブメールでも PGP

        firefox  chrome  pgp 
        Mailvelope - Mailvelope でウェブメールでも PGP

        Mailvelope というブラウザ上で PGP 暗号化/復号化ができるアドオンを見つけたのでメモ。
        中身は OpenPGP.jsを使って作られているようです。

        GnuPG から鍵を Export して使ってみたところ、Outlook Web 上暗号化されたメッセージが復号できました。
        ただ、送信時は PGP Inline 形式になるので、日本語を含んだメッセージを署名だけしようとすると検証できなくなるという問題があります

        Mailvelope

        The browser extension Mailvelope provides end-to-end encryption for your existing email address. Encrypt your mails without having to change your email provider! Encryption and decryption takes place exclusively on the end devices. This means that your private data will never leave your device unencrypted.

        Firefox や Chrome のプラグインは以下から導入が可能です。


          at 23:17 |
          2019/09/09

          CentOS 7 + MariaDB の組み合わせで gem mysql2 がエラーになるときは

          ruby  centos7  mysql 

          CentOS 7 に MariaDB をインストールして、Ruby の gem mysql2 実行したらエラーになってしまって困ってしまいました。

          エラーメッセージを読む限りリンカのエラーのようなので、もう一度良く MariaDB のインストールを確認したら MariaDB-shared が入っていないのが原因だったようで、以下のコマンド1行で解決でした。MariaDB-devel だけでいけると思っていたのが、勘違いでしたね。

          yum install -y MariaDB-shared

          CentOS 7 への MariaDB のインストール

          ハマらないように次回からは以下のような感じでインストールすることにしようと思います。

          curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash yum install -y MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared systemctl start mariadb systemctl enable mariadb mysql_secure_installation

            at 16:28 |
            2019/08/02

            Twitter を旧バージョンに戻すアドオン

            firefox  chrome 

            Twitter はウェブの UI が大幅な変更が行なわれましたが、これを元に戻してしまうアドオンが公開されてたのでメモ。
            最近のウェブがスマホ重視なのはしょうがないのですが、PC で見ると余白が大きくなりすぎてしまって使い辛いんですよね。

            PC版Twitterの新デザインに戸惑う人に朗報 インストールするだけで旧式に戻せるブラウザ拡張が登場 - ねとらぼ

            使い方は各バージョンのページを開き、「Chromeに追加」や「Add to Firefox」をクリックし適用するだけ。導入以降にTwitterを開くと、自動的に旧デザインで表示されます。

              at 21:33 |
              2019/07/05

              MariaDB を 10.3 にしようとしたら「A manual upgrade is required.」と言われたので・・・

              mysql 

              先日、CentOS 7 の MariaDB を 10.3 にアップデートした話を書きましたが、10.1 → 10.3 の場合は 「A manual upgrade is required. 」と言われてしまうことが分かりました。
              ちょうど yum でアップデートしようとすると、以下のようなエラーが出ます。

              Resolving Dependencies --> Running transaction check ---> Package MariaDB-server.x86_64 0:10.1.40-1.el7.centos will be updated ---> Package MariaDB-server.x86_64 0:10.3.16-1.el7.centos will be an update --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================== Updating: MariaDB-server x86_64 10.3.16-1.el7.centos mariadb-main 24 M Transaction Summary ======================================================================================================================================== Upgrade 1 Package Total download size: 24 M Is this ok [y/d/N]: y Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. MariaDB-server-10.3.16-1.el7.centos.x86_64.rpm | 24 MB 00:00:50 Running transaction check Running transaction test Transaction test succeeded Running transaction ****************************************************************** A MySQL or MariaDB server package (MariaDB-server-10.1.40-1.el7.centos.x86_64) is installed. Upgrading directly from MySQL 10.1 to MariaDB 10.3 may not be safe in all cases. A manual dump and restore using mysqldump is recommended. It is important to review the MariaDB manual's Upgrading section for version-specific incompatibilities. A manual upgrade is required. - Ensure that you have a complete, working backup of your data and my.cnf files - Shut down the MySQL server cleanly - Remove the existing MySQL packages. Usually this command will list the packages you should remove: rpm -qa | grep -i '^mysql-' You may choose to use 'rpm --nodeps -ev <package-name>' to remove the package which contains the mysqlclient shared library. The library will be reinstalled by the MariaDB-shared package. - Install the new MariaDB packages supplied by MariaDB Foundation - Ensure that the MariaDB server is started - Run the 'mysql_upgrade' program This is a brief description of the upgrade process. Important details can be found in the MariaDB manual, in the Upgrading section. ****************************************************************** error: %pre(MariaDB-server-10.3.16-1.el7.centos.x86_64) scriptlet failed, exit status 1 Error in PREIN scriptlet in rpm package MariaDB-server-10.3.16-1.el7.centos.x86_64 Verifying : MariaDB-server-10.3.16-1.el7.centos.x86_64 1/2 MariaDB-server-10.1.40-1.el7.centos.x86_64 was supposed to be removed but is not! Verifying : MariaDB-server-10.1.40-1.el7.centos.x86_64 2/2 Failed: MariaDB-server.x86_64 0:10.1.40-1.el7.centos MariaDB-server.x86_64 0:10.3.16-1.el7.centos Complete!

              仕方がないのでマニュアルでアップデート

              マニュアルでアップデートと言っても、やることは一旦アンインストールしてから、再インストールするだけです。
              とりあえずエラーメッセージに従って、非互換な部分について確認します。
              やはり主な問題は sql_mode の部分でしょうか。

              ちなみに yum remove しても /var/lib/mysql の下のデータファイルは消えませんが、念のため全データのダンプは取っておきます。
              .conf は .rpmsave にリネームされてしまうので、特別な設定を入れている場合にはファイルを復元しておきます。

              具体的には以下のような感じでしょうか。

              systemctl stop mariadb yum remove MariaDB-server yum install MariaDB-server mv /etc/my.cnf.d/server.conf{,.bak} mv /etc/my.cnf.d/server.conf{.rpmsave,} systemctl start mariadb mysql_upgrade -u root -p

                at 18:16 |
                2019/06/22

                CORS エラーを無理やり回避する

                firefox 

                AJAX を利用するウェブサイトを使っていると、たまに CORS に関するエラー*1に遭遇して動かないことがありますが、これは基本的に開発者が対処すべき問題*2なので、利用者としては利用をあきらめるくらいしかできないので困っていましたが、Allow CORS というアドオンを使うとこのエラーを無理やり回避できることが分かったのでメモ。

                これを常用するのは危険ですが、どうしても利用したいサイトがある場合には有効な打開策になります。

                Allow CORS: Access-Control-Allow-Origin – 🦊 Firefox (ja) 向け拡張機能を入手

                Simply activate the add-on and perform the request. CORS or Cross Origin Resource Sharing is blocked in modern browsers by default (in JavaScript APIs). Installing this add-on will allow you to unblock this feature. Please note that, when the add-on is added to your browser, it is in-active by default (toolbar icon is grey C letter). If you want to activate the add-on, please press on the toolbar icon once. The icon will turn to orange C letter.

                at 14:42 |
                «Prev || 1 · 2 · 3 · 4 · 5 ·... | | Next»
                » ArchiveList (Tag for "mysql / firefox" )