[Y]を入れていく画面に変わりません。

このQ&Aのポイント
  • MySQLサーバーに接続できません。
  • rootユーザーのパスワードを入力してください。
  • MySQLの設定を確認してください。
回答を見る
  • ベストアンサー

[Y]を入れていく画面に変わりません。

[root@ /]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Enter current password for root (enter for none): [Y]を入れていく画面に変わりません。 どうしてでしょうか? 教えてください。 ご回答の程、宜しくお願い申し上げます。

質問者が選んだベストアンサー

  • ベストアンサー
  • bunjii
  • ベストアンサー率43% (3589/8248)
回答No.4

何時もの悪い癖が出てますね。 前提条件くらい提示された方が良いと思います。 OSは?(Linuxのデストリビューションは?) SQLサーバーはMariaDBですか?(起動してますよね?) SQLサーバーのユーザーとOSのユーザーの管理は別物と言うことをご存知ですか? 初期状態で起動しているSQLサーバーのrootにはパスワードが設定されていないことをご存知ですか? もし、CentOS 7のミニマム構成でWebサーバーを構築されるのでしたら英語の習得から始めてください。 CUIのShellでコマンド投入ではメッセージが英語になるので読んで理解できないとトラブル対策が困難です。 >Enter current password for root (enter for none): 此処で何をしましたか?

jump7799
質問者

お礼

すみません。

その他の回答 (3)

回答No.3

だから~ 前回他の人が答え教えたでしょ・・・これ ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) SQLがないのにコマンドをたたいたから出てるの! パスワードだとかそういう問題じゃなくて、 SQLがそもそも立ち上がっていないから、SQLのコマンドは すべて無効なの! って前回教えてもらった通り。。 そこを治さなければ、無関係なコマンドをむやみにたたいたところで 何も変わらないですって。 回答として、  問題点そのものを治してください。  問題点を無視するのは、やめましょ!  今やってることは無関係なことを聞いて実行しようとしてます。

jump7799
質問者

お礼

ご回答誠にありがとうございます。

  • Kaneyan-R
  • ベストアンサー率42% (1242/2891)
回答No.2

socket errorが出ているから。 検索すれば対処方法はすぐ分かると教えましたよね? 検索すらしないのですか?

jump7799
質問者

お礼

OSをCentOS7からUbuntu18.04に変えました。 すみません。

  • wormhole
  • ベストアンサー率28% (1619/5653)
回答No.1

>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 原因は書いてあるようですけど?

jump7799
質問者

お礼

ご回答誠にありがとうございます。

関連するQ&A

  • パスワードが通りません!

    Ubuntu22.04でWorPressを設定しようと思っているのですが 下記でどんなパスワードも通りません。 どういう仕組みになっているのでしょうか? パスワードは何を入れればいいのでしょうか? $ sudo mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    • ベストアンサー
    • MySQL
  • [y]を5回ほど入力する画面にならない。

    $ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) $ sudo apt install mysql-server mysql-client パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 以下のパッケージが自動でインストールされましたが、もう必要とされていません: galera-3 libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 libterm-readkey-perl mariadb-common socat これを削除するには 'sudo apt autoremove' を利用してください。 以下の追加パッケージがインストールされます: libevent-core-2.1-6 mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7 提案パッケージ: mailx tinyca 以下のパッケージは「削除」されます: mariadb-client mariadb-client-10.1 mariadb-client-core-10.1 mariadb-server mariadb-server-10.1 mariadb-server-core-10.1 以下のパッケージが新たにインストールされます: libevent-core-2.1-6 mysql-client mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7 アップグレード: 0 個、新規インストール: 7 個、削除: 6 個、保留: 0 個。 20.4 MB 中 0 B のアーカイブを取得する必要があります。 この操作後に 11.0 MB のディスク容量が解放されます。 続行しますか? [Y/n] y パッケージを事前設定しています ... (データベースを読み込んでいます ... 現在 190376 個のファイルとディレクトリがインストールされています。) mariadb-client (1:10.1.38-0ubuntu0.18.04.1) を削除しています ... mariadb-server (1:10.1.38-0ubuntu0.18.04.1) を削除しています ... mariadb-server-10.1 (1:10.1.38-0ubuntu0.18.04.1) を削除しています ... mariadb-client-10.1 (1:10.1.38-0ubuntu0.18.04.1) を削除しています ... mariadb-client-core-10.1 (1:10.1.38-0ubuntu0.18.04.1) を削除しています ... mariadb-server-core-10.1 (1:10.1.38-0ubuntu0.18.04.1) を削除しています ... 以前に未選択のパッケージ mysql-client-core-5.7 を選択しています。 (データベースを読み込んでいます ... 現在 190107 個のファイルとディレクトリがインストールされています。) .../0-mysql-client-core-5.7_5.7.25-0ubuntu0.18.04.2_amd64.deb を展開する準備をしています ... mysql-client-core-5.7 (5.7.25-0ubuntu0.18.04.2) を展開しています... 以前に未選択のパッケージ mysql-client-5.7 を選択しています。 .../1-mysql-client-5.7_5.7.25-0ubuntu0.18.04.2_amd64.deb を展開する準備をしています ... mysql-client-5.7 (5.7.25-0ubuntu0.18.04.2) を展開しています... 以前に未選択のパッケージ mysql-server-core-5.7 を選択しています。 .../2-mysql-server-core-5.7_5.7.25-0ubuntu0.18.04.2_amd64.deb を展開する準備をしています ... mysql-server-core-5.7 (5.7.25-0ubuntu0.18.04.2) を展開しています... 以前に未選択のパッケージ libevent-core-2.1-6:amd64 を選択しています。 .../3-libevent-core-2.1-6_2.1.8-stable-4build1_amd64.deb を展開する準備をしています ... libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) を展開しています... 以前に未選択のパッケージ mysql-server-5.7 を選択しています。 .../4-mysql-server-5.7_5.7.25-0ubuntu0.18.04.2_amd64.deb を展開する準備をしています ... Downgrade from (at least) 10.1 to 5.7 is not possible. Packaging maintenance of MySQL will stop and the daemon disabled to prevent damage to your system. For help, see /etc/mysql/FROZEN mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) を展開しています... 以前に未選択のパッケージ mysql-client を選択しています。 .../5-mysql-client_5.7.25-0ubuntu0.18.04.2_all.deb を展開する準備をしています ... mysql-client (5.7.25-0ubuntu0.18.04.2) を展開しています... 以前に未選択のパッケージ mysql-server を選択しています。 .../6-mysql-server_5.7.25-0ubuntu0.18.04.2_all.deb を展開する準備をしています ... mysql-server (5.7.25-0ubuntu0.18.04.2) を展開しています... libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) を設定しています ... ureadahead (0.100.0-20) のトリガを処理しています ... mysql-server-core-5.7 (5.7.25-0ubuntu0.18.04.2) を設定しています ... libc-bin (2.27-3ubuntu1) のトリガを処理しています ... systemd (237-3ubuntu10.12) のトリガを処理しています ... man-db (2.8.3-2ubuntu0.1) のトリガを処理しています ... ubuntu18.04 どうしてこうなるのでしょうか? 宜しくお願い申し上げます。

    • ベストアンサー
    • MySQL
  • パスワードがループする。

    いつも大変お世話になり誠にありがとうございます。 下記のようにパスワードがループするのですけど 解決策はありませんか? root@GD348ZZD9:~# sudo mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password. The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Please set the password for root here. New password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y ... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters. New password: 色々とすみません。 ご回答のほど、よろしくお願い申し上げます。

  • コマンドプロントにて

    度々すみません・・・ depot>mysql -u root -p Enter password:****** Welcome to the MySQL moniter. Commands end with ; or \g. mysql> grant all on depot_development.*to'dave'@'localhost'; ここでエンターを押すと ERROR 1133 (42000):Can't find any matching row in the user table と出ますがよくわかりません・・・ どなたか助けてください!

    • ベストアンサー
    • MySQL
  • Mysqlに入れません

    PHPのパッケージxamppでMySQL 5.0.51aをインストールしています。 しかしどうあがいてもMySQLに入れません。 C:\xampp\mysql\bin>mysql ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) C:\xampp\mysql\bin>mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) C:\xampp\mysql\bin>mysql -u root -p root Enter password: **** ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 教えてください。お願いいたします。

    • ベストアンサー
    • MySQL
  • MYSQLのデータベース初期化ができません

    SentOS上でMYSQLをインストールしたいのですが、 データベース初期化時に下記のメッセージが出力され、 書籍では作成されると書いてある「var」フォルダが 作成されません。 [root@2 usr]# /usr/local/mysql/bin/mysql_install_db --user=mysql Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/local/mysql/bin/mysqladmin -u root password 'new-password' /usr/local/mysql/bin/mysqladmin -u root -h 2.0.168.192.in-addr.arpa password 'new-password' Alternatively you can run: /usr/local/mysql/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/local/mysql/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com どなたか対処方が分る方教えて下さい。 よろしくお願いいたします。

  • mysqlが起動しなくなりました。

    LINUXでmysqlを使用してます。 誤って、mysqlのデータベースをdropしてしまいアンインストール後、再びインストールし、使用したところ下記の様になりました。以前はパスワード無しでもできたのですが、パスワードを求められたり・・・と変わってしまいました。3306のPORTはmysqlに割り振られてるのですが・・・。 # mysql ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO) # mysql -u root ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO) # mysql -p Enter password: ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES) # ps ax | mysqld 051007 11:31:57 Can't start server: Bind on TCP/IP port: Address already in use 051007 11:31:57 Do you already have another mysqld server running on port: 3306 ? 051007 11:31:57 Aborting 051007 11:31:57 mysqld: Shutdown Complete

    • ベストアンサー
    • MySQL
  • [Linux] MySQL4をインストール後、mysql.cnf上で指定した.sockを読み取らないエラーについて質問です

    初心者で質問の内容が薄いかもしれないですが、よろしくお願いします。 現状LinuxのサーバにはMySQL3が入っており、稼動中です。 そこに新規でMySQL4をインストールしたのですが、 /usr/local/mysql/4122/bin/mysql_install_db --user=mysql 上記コマンドで初期化をしようと思ったらエラーだと思うのですが 下記のような文が出てきました。 PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/local/mysql/4122/bin/mysqladmin -u root password 'new-password'! これはrootのパスワードを設定しないといけないのだと思って設定しようとしました。 するとエラー文が。。 error: 'Can't connect to local MySQL server through socket '/usr/local/mysql/4122/mysql.sock' (2)' Check that mysqld is running and that the socket: '/usr/local/mysql/4122/mysql.sock' exists! mysql.sockの場所は /usr/local/mysql/4122/share/mysql/mysql.sock にあるんで、この場所を /usr/local/mysql/4122/share/mysql/my-large.cnf このmy-large.cnfに記述してありますが、なぜエラー文で下記の場所を読み取っているのかわからなくて困ってます。。 socket: '/usr/local/mysql/4122/mysql.sock' exists! どうかお助けください。 よろしくお願いします!

  • mysqlのユーザパスワードについて

    mysqlのユーザパスワードについて こんばんわ。mysql初心者です。 現在、サーバ(Linux Fedora11)でyumコマンドからmysql(Server version: 5.1.45 Source distribution) をダウンロードしてインストールしています。 新しいユーザーを作って接続を試みたのですが出来ません。 原因を調査した結果、パスワードが設定出来ていないようです。 一連の作業を例として下記の通りです。 例)------------------------------------------------------------------------------- [root@fedora user]# mysql -u root mysql> grant all privileges on *.* to user@"%" identified by 'user' with grant option; mysql> grant all privileges on *.* to user@localhost identified by 'user' with grant option; mysql> select user,host,password from mysql.user; +----+-----------------+-----------------+ | user | host           | password        | +----+-----------------+-----------------+ | root | localhost        |             | | root | fedora.fedorasrv.com |             | | root | 127.0.0.1        |             | | user | localhost        | 1a486e7929011a28 | | user | #             | 1a486e7929011a28 | +----+-----------------+-----------------+ mysql> exit; [root@fedora user]# mysql -u user -p 1a486e7929011a28 Enter password: ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO) [root@fedora user]# mysql -u user ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO) [root@fedora user]# mysql -u user -p user Enter password: ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO) ---------------------------------------------------------------------------------- userユーザのパスワードが保護(?)なのか設定した内容と違います。 保護されたパスワードで打ってもノーパスワードで打っても設定したパスワードでも接続出来ません。 ちなみに他のユーザで作成しても保護されたパスワードです。 どのようにしたら設定した通りのパスワードが作成されるかご教授願います。

    • ベストアンサー
    • MySQL
  • mysqlのユーザパスワードについて

    mysqlのユーザパスワードについて こんばんわ。mysql初心者です。 現在、サーバ(Linux Fedora11)でyumコマンドからmysql(Server version: 5.1.45 Source distribution)をダウンロードしてインストールしています。 新しいユーザーを作って接続を試みたのですが出来ません。 原因を調査した結果、パスワードが設定出来ていないようです。 一連の作業を例として下記の通りです。 例)------------------------------------------------------------------------------- [root@fedora user]# mysql -u root mysql> grant all privileges on *.* to user@"%" identified by 'user' with grant option; mysql> grant all privileges on *.* to user@localhost identified by 'user' with grant option; mysql> select user,host,password from mysql.user; +----+-----------------+-----------------+ | user | host           | password        | +----+-----------------+-----------------+ | root | localhost        |             | | root | fedora.fedorasrv.com |             | | root | 127.0.0.1        |             | | user | localhost        | 1a486e7929011a28 | | user | #             | 1a486e7929011a28 | +----+-----------------+-----------------+ mysql> exit; [root@fedora user]# mysql -u user -p 1a486e7929011a28 Enter password: ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO) [root@fedora user]# mysql -u user ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO) [root@fedora user]# mysql -u user -p user Enter password: ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO) ---------------------------------------------------------------------------------- userユーザのパスワードが保護(?)なのか設定した内容と違います。 保護されたパスワードで打ってもノーパスワードで打っても設定したパスワードでも接続出来ません。 ちなみに他のユーザで作成しても保護されたパスワードです。 どのようにしたら設定した通りのパスワードが作成されるかご教授願います。

    • ベストアンサー
    • MySQL