LinuxMySQL日記

mysqldumpでバックアップ mysqlで復元

1 Mins read

MySqlのバックアップと復元について

CentOS 6.9 x64
MariaDB 10.1.25(xampp linux x64 5.6.31内)

最近xampp内にあるのはMariaDBとなっていますが。。。オープンソースが分かれた感じね。これ昔のSybaseとSQLServerと同じやつだ(汗)MySqlがOracleに買収されて相変わらずオープンソースだけどライセンス系でめんどくさいから分けちゃえってやつ。そういえばUnixとLinuxもそんな感じだよね。アメリカ人(Linuxは欧米かぁ)は昔からライセンスの緩いVS固いで戦ってるけど、こちらは使ってて名前違うのに、中身はほぼ一緒なの、なんで?って疑問、若い人に教えるの大変なんだよなぁ。そういえばOpenSSLも確かオープンソース団体の脆弱性修正が遅すぎるってGoogleが別プロジェクト作っちゃったのこの前見た。。。

まえがきはさておき、xamppや複数のMySqlを1台で運用(あまりやらんが使用ポートを分ければ複数インスト可能)するときに「sock」指定(プロセス指定)が必要なのでその部分も含めてコマンド書いときます。

yum使ってMySqlを標準インストールした場合、Pathが普通に切られているから、他のネット情報のように「sock」部分はカットして使ってください。

■バックアップ(使い勝手がよいのでバイナリでアウトプット)
# ./mysqldump --default-character-set=binary --socket=/opt/lampp/var/mysql/mysql.sock -u root -p dbname > /opt/dump.sql

■復元
# ./mysql --socket=/opt/lampp/var/mysql/mysql.sock -u root -p dbname < /opt/dump.sql

Read more
Linux日記

CentOS 6.9 (64bit) に xampp linux x64 5.6.31 をインストール

3 Mins read

久しぶりに環境設定で少しハマったので書き込み

CentOS 6.9 (64bit) にxampp linux x64 5.6.31 をインストールしたら以下のエラーで起動できない。

# ./lampp start
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
 
id: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/share/xampp/xampplib: line 11: test: -ne: unary operator expected
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/httpd: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

「libc.so.6」ライブラリが無いか?環境変数のPathがおかしいんだろうと決め込んで確認コマンド投げる

yumで確認
#yum provides */libc.so.6
 
読み込んだプラグイン:fastestmirror, security
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
base/filelists_db | 6.4 MB 00:00
extras/filelists_db | 25 kB 00:00
updates/filelists_db | 2.9 MB 00:00
glibc-2.12-1.209.el6.x86_64 : The GNU libc libraries
リポジトリー : base
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6.i686 : The GNU libc libraries
リポジトリー : base
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6
 
glibc-2.12-1.209.el6_9.1.i686 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6
 
glibc-2.12-1.209.el6_9.2.i686 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6
 
glibc-2.12-1.209.el6_9.2.x86_64 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6_9.1.x86_64 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6_9.2.x86_64 : The GNU libc libraries
リポジトリー : installed
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6_9.2.i686 : The GNU libc libraries
リポジトリー : installed
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6

いるね~

なんじゃ?リンク切れか?。。。リンクあるし???
はて?

起動時にエラー?

起動ファイルlampp=xamppファイルなのでviでオープンし中身確認

どうやら起動時のOSバージョンチェックで読み込み先共通ライブラリが違っていることが原因見たいだけど、このエラーメッセージからはそんなこと読み取れん!Cのデバッグと同じで落ちている箇所やエラーメッセージに騙されてはいかんやつやな(笑)本質の問題を見分ける所は。。。人生と同じか(苦笑)

CentOSのバージョン確認「2.6.32」部分がキーとなっておりこれを超えているか?のチェックっぽい
#more /proc/version
Linux version 2.6.32-696.13.2.el6.x86_64 (mockbuild@c1bl.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Thu O
ct 5 21:22:16 UTC 2017

viでxamppを開き436行目の
「export LD_ASSUME_KERNEL=2.2.5」

「export LD_ASSUME_KERNEL=2.8.0」
へ変更してあげる

こんな感じ
# do we have that new red hat linux 9 with posix native threads?
if test $(osguess) = "rh9"
then
# for now disable PNTL. if PNTL gets more popular we will support it. - oswald [8apr3]
export LD_ASSUME_KERNEL=2.8.0
#echo "XAMPP: DISABLE PNTL..."
fi

これで無事起動♪
#./lampp start

Read more
日記

Exchange Server 2010 クライアントのメールボックス使用量確認コマンド

1 Mins read

Exchange Server 2010 クライアントのメールボックス使用量の確認がEMCでは出来ないのでShellコマンドにて確認する

Get-MailboxStatistics -Server 'hoge.hogehoge.local'
Get-MailboxStatistics -Database 'Mailbox Database 1234567890'
Get-MailboxStatistics -Identity 'hogehoge\user01' | select displayname, totalitemsize

Read more
ApacheLinux日記

CentOS6.4 Apache 2.4.4 SSL 本番環境コピーでエラーとなる

1 Mins read

本番環境からconf系ファイルをコピーして使用できるよう環境構築時に嵌ったので覚書!

コピーしてきてapacheが起動しない、confテストはOK

error_logに以下の記載がある

AH02311: Fatal error initialising mod_ssl,

ssl用のアクセスログを見ると。。。

AH02204: Init: Pass phrase incorrect for key of localhost.local:443
SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
SSL Library Error: error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error
SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
SSL Library Error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error (Type=RSA)
SSL Library Error: error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib
SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
SSL Library Error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error (Type=PKCS8_PRIV_KEY_INFO)

「Init: Pass phrase incorrect」とはSSL用の起動時passがないと言っている。。。はて?

決められた場所にpasswordファイルがあり、「SSLPassPhraseDialog exec:」のpassが間違っているのかと確認する。。。あってる。。。はて?

1時間ほど苦悶しながら調べる。。。あっ!?コピーしたから実行権限がなくなっているんだ!そう、このファイル内だけbshellが記載してあるんだ。。。とほほ、basic認証のpasswordファイルなどは関係ないのに。。。(すでに言い訳、笑)

Read more
Windows Serverパソコンのこと日記

ASUS Z87 Intel I217-V Windows Server 2008R2 2012 2012R2 NIC Driver

2 Mins read

ASUS Z87マザーについているIntel I217-VのネットワークドライバーがWindows Server(x64)系OSに対応していないので、Windows7 or Windows8系のドライバーをinf書き換えで対応させる覚書

1.Intel Ethernet Connectionsをダウンロード(ver18.7)

2.「PRO1000」「Winx64」の下にある「NDIS62」「NDIS63」「NDIS64」各フォルダ内から以下のファイルをEditする。この時バイナリエディッタで修正しないと他国の言語が文字化けしてしまう。日本のみで使用する場合は、Shift_JisでOpen、CloseしてOK!

「e1d62x64.inf」
「e1d63x64.inf」
「e1d64x64.inf」

このファイルたちの以下の箇所を開く「ControlFlags」で検索するとよい

[ControlFlags]
ExcludeFromSelect = \
PCI\VEN_8086&DEV_153A,\
PCI\VEN_8086&DEV_153B
 
[Intel]
 
[Intel.NTamd64.6.3.1]
; DisplayName Section DeviceID
; ----------- ------- --------
%E153ANC.DeviceDesc% = E153A.6.3.1, PCI\VEN_8086&DEV_153A
%E153ANC.DeviceDesc% = E153A.6.3.1, PCI\VEN_8086&DEV_153A&SUBSYS_00008086
%E153ANC.DeviceDesc% = E153A.6.3.1, PCI\VEN_8086&DEV_153A&SUBSYS_00011179
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B&SUBSYS_00008086
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B&SUBSYS_00011179
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A&SUBSYS_00008086
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A&SUBSYS_00011179
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A&SUBSYS_90BA104D
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559&SUBSYS_00008086
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559&SUBSYS_00011179
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559&SUBSYS_90BA104D
 
[Intel.NTamd64.6.3]
; DisplayName Section DeviceID
; ----------- ------- --------
%E153ANC.DeviceDesc% = E153A, PCI\VEN_8086&DEV_153A
%E153ANC.DeviceDesc% = E153A, PCI\VEN_8086&DEV_153A&SUBSYS_00008086
%E153ANC.DeviceDesc% = E153A, PCI\VEN_8086&DEV_153A&SUBSYS_00011179
%E155ANC.DeviceDesc% = E155A, PCI\VEN_8086&DEV_155A
%E155ANC.DeviceDesc% = E155A, PCI\VEN_8086&DEV_155A&SUBSYS_00008086
%E155ANC.DeviceDesc% = E155A, PCI\VEN_8086&DEV_155A&SUBSYS_00011179

上記に対して「E153B.6.3.1」の部分をコピーして以下とする

[ControlFlags]
ExcludeFromSelect = \
PCI\VEN_8086&DEV_153A,\
PCI\VEN_8086&DEV_153B
 
[Intel]
 
[Intel.NTamd64.6.3.1]
; DisplayName Section DeviceID
; ----------- ------- --------
%E153ANC.DeviceDesc% = E153A.6.3.1, PCI\VEN_8086&DEV_153A
%E153ANC.DeviceDesc% = E153A.6.3.1, PCI\VEN_8086&DEV_153A&SUBSYS_00008086
%E153ANC.DeviceDesc% = E153A.6.3.1, PCI\VEN_8086&DEV_153A&SUBSYS_00011179
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B&SUBSYS_00008086
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B&SUBSYS_00011179
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A&SUBSYS_00008086
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A&SUBSYS_00011179
%E155ANC.DeviceDesc% = E155A.6.3.1, PCI\VEN_8086&DEV_155A&SUBSYS_90BA104D
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559&SUBSYS_00008086
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559&SUBSYS_00011179
%E1559NC.DeviceDesc% = E1559.6.3.1, PCI\VEN_8086&DEV_1559&SUBSYS_90BA104D
 
[Intel.NTamd64.6.3]
; DisplayName Section DeviceID
; ----------- ------- --------
%E153ANC.DeviceDesc% = E153A, PCI\VEN_8086&DEV_153A
%E153ANC.DeviceDesc% = E153A, PCI\VEN_8086&DEV_153A&SUBSYS_00008086
%E153ANC.DeviceDesc% = E153A, PCI\VEN_8086&DEV_153A&SUBSYS_00011179
%E155ANC.DeviceDesc% = E155A, PCI\VEN_8086&DEV_155A
%E155ANC.DeviceDesc% = E155A, PCI\VEN_8086&DEV_155A&SUBSYS_00008086
%E155ANC.DeviceDesc% = E155A, PCI\VEN_8086&DEV_155A&SUBSYS_00011179
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B&SUBSYS_00008086
%E153BNC.DeviceDesc% = E153B.6.3.1, PCI\VEN_8086&DEV_153B&SUBSYS_00011179

3.これでデバイスからドライバー更新してあげればOK!(署名がないのであやしいと言われるがインストール!)

当たり前ですが、補償はないので、自己判断でお願いします!

Read more