Ubuntu 16.04とmysqlの喜び

Ubuntu 16.04とmysqlの喜び

この記事を最後まで読んでいくつかのアイデアをいただいたら、あらかじめ感謝の言葉を伝えたいと思います。たくさん。

私は64ビットDell 1820でUbuntu 16.04を使用しています。 Windowsとデュアルブートされ、16.04がリリースされて以来、この設定を使用してきました。これまで、この設定ではApache、PHP、またはMySQLを使用していませんでした。

私はローカルWordPressを設定したいので、amppsという名前の「ワンクリック」ソリューションを使用しました。これは、1つのLAMPに400以上のプログラムをまとめたものです。ただし、PHPのデフォルトバージョンは5.5であり、多くのアプリケーション(おそらくほとんど)がamppsダッシュボードを介してそのバージョンを使用できないことを報告します。 PHP 7に切り替える方法を見つけた後、WordPressから私に通知を送信しました。

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

彼らの支援システムとフォーラムの多数の投稿は、私をどこに閉じ込めることができないのでここにあります。

amppsのデフォルト設定は次のとおりです。

  1. 7.0または7.1にはphp.iniファイルはありません。

  2. PHP 5.3と5.5にはiniファイルがあります。

  3. WINEパスを介してiniファイルを開き、メモ帳のバージョンで開きます。これは危険信号ですか?

だから私はすでにUbuntu 16.04の一部として独自のMySQLとPHP 7を持っていると思いました。 Apacheをインストールして設定できます。 4~5年が過ぎましたが、やりました。 mysqlを直接開こうとしています。

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

だからわかりました。/var/run/mysqld/mysqld.sockはありません。 /var/run/mysqldもありません!

ランダムなインターネットを遅らせて/etc/mysql/my.cnfをチェックする必要があると思いました。ただし、このファイルには1行しかありません。

!includedir /etc/mysql/conf.d/

conf.d/mysql.conf の内容は次のとおりです。

[mysql]

そのため、ポートとローカルホストをmy.cnfに入れましたが、その時点で新しい致命的なエラーが発生しました。

再起動後:

malikarumi@Tetuoan2:~$ mysql mysql: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 19! mysql: [ERROR] Fatal error in defaults handling. Program aborted! malikarumi@Tetuoan2:~$

port=3306 # this is line 19 bind-address=127.0.0.1

その結果、my.cnfの最初の行に[mysql]を入れる必要がありました。今私は私が始めた場所に戻ってきました。行くところもありませんでした。

mysql 5.6をアンインストールして再インストールして再起動することにしました。まあ、それもうまくいきませんでした。

malikarumi@Tetuoan2:~$ sudo apt-get install mysql-server Reading package lists... Done' 'Building dependency tree
Reading state information... Done The following packages were automatically installed and are no longer required: libmircommon5 linux-headers-4.4.0-78 linux-headers-4.4.0-78-generic linux-headers-4.4.0-79 linux-headers-4.4.0-79-generic linux-image-4.4.0-78-generic linux-image-4.4.0-79-generic linux-image-extra-4.4.0-78-generic linux-image-extra-4.4.0-79-generic linux-signed-image-4.4.0-78-generic linux-signed-image-4.4.0-79-generic Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libevent-core-2.0-5 libhtml-template-perl mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7 Suggested packages: libipc-sharedcache-perl tinyca The following packages will be REMOVED: mysql-client-core-5.6 mysql-server-core-5.6 The following NEW packages will be installed: libevent-core-2.0-5 libhtml-template-perl mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7 0 upgraded, 7 newly installed, 2 to remove and 0 not upgraded. Need to get 18.3 MB of archives. After this operation, 113 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-core-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [6,340 kB] Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-core-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [7,566 kB] Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [1,725 kB] Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libevent-core-2.0-5 amd64 2.0.21-stable-2ubuntu0.16.04.1 [70.6 kB] Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [2,554 kB] Get:6 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libhtml-template-perl all 2.95-2 [60.4 kB] Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server all 5.7.18-0ubuntu0.16.04.1 [10.8 kB] Fetched 18.3 MB in 24s (746 kB/s)
Preconfiguring packages ... dpkg: mysql-client-core-5.6: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mysql-client-core-5.7 | virtual-mysql-client-core; however: Package mysql-client-core-5.7 is not installed. Package virtual-mysql-client-core is not installed. Package mysql-client-core-5.6 which provides virtual-mysql-client-core is to be removed.

(Reading database ... 374021 files and directories currently installed.) Removing mysql-client-core-5.6 (5.6.31-0ubuntu0.15.10.1) ... Processing triggers for man-db (2.7.5-1) ... Selecting previously unselected package mysql-client-core-5.7. (Reading database ... 374013 files and directories currently installed.) Preparing to unpack .../mysql-client-core-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-client-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... dpkg: mysql-server-core-5.6: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mysql-server-core-5.7 | virtual-mysql-server-core; however: Package mysql-server-core-5.7 is not installed. Package virtual-mysql-server-core is not installed. Package mysql-server-core-5.6 which provides virtual-mysql-server-core is to be removed.

(Reading database ... 374022 files and directories currently installed.) Removing mysql-server-core-5.6 (5.6.31-0ubuntu0.15.10.1) ... Processing triggers for man-db (2.7.5-1) ... Selecting previously unselected package mysql-server-core-5.7. (Reading database ... 373927 files and directories currently installed.) Preparing to unpack .../mysql-server-core-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-server-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Selecting previously unselected package mysql-client-5.7. Preparing to unpack .../mysql-client-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-client-5.7 (5.7.18-0ubuntu0.16.04.1) ... Selecting previously unselected package libevent-core-2.0-5:amd64. Preparing to unpack .../libevent-core-2.0-5_2.0.21-stable-2ubuntu0.16.04.1_amd64.deb ... Unpacking libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ... Selecting previously unselected package mysql-server-5.7. Preparing to unpack .../mysql-server-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-server-5.7 (5.7.18-0ubuntu0.16.04.1) ... Selecting previously unselected package libhtml-template-perl. Preparing to unpack .../libhtml-template-perl_2.95-2_all.deb ... Unpacking libhtml-template-perl (2.95-2) ... Selecting previously unselected package mysql-server. Preparing to unpack .../mysql-server_5.7.18-0ubuntu0.16.04.1_all.deb ... Unpacking mysql-server (5.7.18-0ubuntu0.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for libc-bin (2.23-0ubuntu9) ... /sbin/ldconfig.real: File /usr/local/lib/libQtCore.so is empty, not checked. /sbin/ldconfig.real: /lib/x86_64-linux-gnu/libssl.so.1.0.0 is not a symbolic link

/sbin/ldconfig.real: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 is not a symbolic link

Processing triggers for systemd (229-4ubuntu17) ... Processing triggers for ureadahead (0.100.0-19) ... ureadahead will be reprofiled on next reboot Setting up mysql-client-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Setting up mysql-server-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Setting up mysql-client-5.7 (5.7.18-0ubuntu0.16.04.1) ... Setting up libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ... Setting up mysql-server-5.7 (5.7.18-0ubuntu0.16.04.1) ... update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Renaming removed key_buffer and myisam-recover options (if present) insserv: warning: script 'K01ampps' missing LSB tags and overrides insserv: warning: script 'K01httpd' missing LSB tags and overrides insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須開始: '項目: 空であっても追加します。 insserv: 不足しているRequired-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始: '項目: 空であっても追加します。 insserv: 不足しているRequired-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始: '項目: 空であっても追加します。 insserv: 不足しているRequired-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始: '項目: 空であっても追加します。 insserv: 不足しているRequired-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始: '項目: 空であっても追加します。 insserv: 不足しているRequired-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始: '項目: 空であっても追加してください。 insserv: 不足しているRequired-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始: '項目: 空であっても追加してください。 insserv: Required-Stop:' entry: please add even if empty. insserv: script mysql: service mysql already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1' libhtml-template-perl(2.95-2) 設定が欠落しています...これは構成されていません。 。 `

dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Processing triggers for libc-bin (2.23-0ubuntu9) ... /sbin/ldconfig.real: File /usr/local/lib/libQtCore.so is empty, not checked. /sbin/ldconfig.real: /lib/x86_64-linux-gnu/libssl.so.1.0.0 is not a symbolic link

/sbin/ldconfig.real: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 is not a symbolic link

Processing triggers for systemd (229-4ubuntu17) ... Processing triggers for ureadahead (0.100.0-19) ... Errors were encountered while processing: mysql-server-5.7 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1) マリカルミ@Tetuoan2:~$

Canonical / Ubuntuシステムでは、私にバグトラッカーをお勧めしました。 https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1623440

ただし、この問題は60日間活動がなかったため、変更されていない「期限切れ」と見なされます。

最後に、apt-show-versionsコマンドを見つけました(ここでは:dpkgはどのパッケージもインストールしません。) だから、何が見つかるのか見てみました。

malikarumi@Tetuoan2:~$ apt-show-versions The program 'apt-show-versions' is currently not installed. You can install it by typing: sudo apt install apt-show-versions malikarumi@Tetuoan2:~$ sudo apt install apt-show-versions [sudo] password for malikarumi: Reading package lists... Done Building dependency tree
Reading state information... Done The following NEW packages will be installed: apt-show-versions 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. Need to get 29.6 kB of archives. After this operation, 163 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 apt-show-versions all 0.22.7 [29.6 kB] Fetched 29.6 kB in 0s (44.9 kB/s)
Selecting previously unselected package apt-show-versions. (Reading database ... 309531 files and directories currently installed.) Preparing to unpack .../apt-show-versions_0.22.7_all.deb ... Unpacking apt-show-versions (0.22.7) ... Processing triggers for man-db (2.7.5-1) ... Setting up mysql-server-5.7 (5.7.18-0ubuntu0.16.04.1) ... Renaming removed key_buffer and myisam-recover options (if present) insserv: warning: script 'K01ampps' missing LSB tags and overrides insserv: warning: script 'K01httpd' missing LSB tags and overrides insserv: Script mongod is broken: incomplete LSB comment. insserv: missing
必須開始: '項目: 空であっても追加します。 insserv:Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始不足: '項目:空でも追加してください。 insserv:Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始不足: '項目:空でも追加してください。 insserv:Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始不足: '項目:空でも追加してください。 insserv:Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始不足: '項目:空でも追加してください。 insserv:Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始不足: '項目:空でも追加してください。 insserv:Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missing必須の開始不足: '項目:空でも追加してください。挿入サービス:欠落しているRequired-Stop:' entry: please add even if empty. insserv: script mysql: service mysql already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured Setting up apt-show-versions (0.22.7) ... No apport report written because the error message indicates its a followup error from a previous failure. ** initializing cache. This may take a while ** Errors were encountered while processing: mysql-server-5.7 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)

malikarumi@Tetuoan2:~$ sudo dpkg --audit The following packages have been unpacked but not yet configured. They must be configured using dpkg --configure or the configure menu option in dselect for them to work: mysql-server MySQL database server (metapackage depending on the lates

The following packages are only half configured, probably due to problems configuring them the first time. The configuration should be retried using dpkg --configure <package> or the configure menu option in dselect: mysql-server-5.7 MySQL database server binaries and system database setup

malikarumi@Tetuoan2:~$ sudo dpkg -C The following packages have been unpacked but not yet configured. They must be configured using dpkg --configure or the configure menu option in dselect for them to work: mysql-server MySQL database server (metapackage depending on the lates

The following packages are only half configured, probably due to problems configuring them the first time. The configuration should be retried using dpkg --configure <package> or the configure menu option in dselect: mysql-server-5.7 MySQL database server binaries and system database setup

Malikarumi@Tetuoan2:~$ sudo dpkg --configure dpkg: エラー: --configure には、1 つ以上のパッケージ名パラメータが必要です。

パッケージのインストールと削除については、dpkg --helpと入力してください[*]ユーザーフレンドリーなパッケージ管理には 'apt'または 'aptitude'を使用してください。 dpkg デバッグフラグ値のリストを表示するには、dpkg --force - と入力します。必須オプションのリストについては、helpと入力してください。 *.deb ファイルの操作に関するヘルプを表示するには、dpkg-deb --help と入力します。

[*] で示されるオプションは、大量の出力を生成します。 「less」または「more」を通してパイプされます!マリカルミ@Tetuoan2:~$

すでに出力に--configureエラーがあることがわかったので、実行しませんでした。

他のUnixスワップの質問では、あなたがしたこととは異なり、私は(意図的に)OSを混在させていませんでした。今回は投稿に行きました。提案?

ベストアンサー1

まぁ、おっしゃった通り全部クリアして再起動するのがいいようです。まず、基本ソフトウェアストアのみを使用していることを確認してくださいapt-get update

ローカルワークステーション開発を設定する方法は次のとおりです(Mint、Mint = Ubuntu)。これは非常に安全ではありません。私が使用する以外は、localhostサービスをファイアウォールでブロックするか、ループバックアダプタにバインドする必要があります。

まずmysqlをインストールしてください。以前のバージョンを完全に削除したことを確認するか、設定したルートパスワードを覚えておく必要があります。 Mint 19 / Ubuntu 18.04では、ネットワークの代わりにソケットを使用すると、一致するユーザー名が自動的に認証され、パスワードは無視されます。新しくインストールすると、痛みを伴うことになります。

それでも、apt-get install mysql-server mysql-client。ある時点で、デフォルトのデータベースとそのユーザー(通常は「lampdev」と呼ばれます)を作成しますが、これはインストール後に完了します。

以下はapache、php、php + mysqlのサポートです---

apt-get install apache2 libapache2-mod-php php-mysql

私も両方を使用する傾向がphpmyadminあるのでmysql-workbench、両方をインストールします。

これはセキュリティの最南端のポイントです。

その後、グループを追加し、webdevここに私のユーザーアカウントwww-dataとユーザーだけでなく()も追加しましたchown -R .webdevDocumentRoot/var/www/htmlchmod g+s

おすすめ記事