mysqlがwindowsサービスで再起動すると立ち上がらなくなる
- 評価
- クリップ 1
- VIEW 1,804

退会済みユーザー
使用環境
win7 32bit
myslq 5.7
行った手順
①インストール後、環境変数にbinのパスを追記 ;C:\Program Files\MySQL\MySQL Server 5.7\bin
②cmdでmysqlにmysql -u root -p でログイン確認
③timezone_posixをcmdに貼り付けタイムゾーン設定
⑤my.iniのSERVER SECTIONにdefault-time-zone = 'Japan'を追記
④windowsサービスでmysql57を一度停止して、再度開始すると、状態 "開始中"になりmysqlへ接続出来なくなる
⑤でのエラーコード
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
mysqlのログのwarning部分
2019-10-31T07:45:32.409326Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2019-10-31T08:14:27.103784Z 0 [Warning] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: Forcing close of thread 8 user: 'root'
my.ini
# Other default tuning values
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# "--defaults-file".
#
# To run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guidelines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
# For advice on how to change settings please see
# https://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
# pipe=
# socket=MYSQL
port=3306
[mysql]
no-beep
# default-character-set=
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
# server_type=2
[mysqld]
default-time-zone = 'Japan'
# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory
# shared-memory-base-name=MYSQL
# The Pipe the MySQL Server will use
# socket=MYSQL
# The TCP/IP Port the MySQL Server will listen on
port=3306
# Path to installation directory. All paths are usually resolved relative to this.
# basedir="C:/Program Files/MySQL/MySQL Server 5.7/"
# Path to the database root
datadir=C:/ProgramData/MySQL/MySQL Server 5.7/Data
# The default character set that will be used when a new schema or table is
# created and no character set is defined
# character-set-server=
# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
# General and Slow logging.
log-output=FILE
general-log=0
general_log_file="PC-20140.log"
slow-query-log=1
slow_query_log_file="PC-20140-slow.log"
long_query_time=10
# Error Logging.
log-error="PC-20140.err"
# ***** Group Replication Related *****
# Specifies the base name to use for binary log files. With binary logging
# enabled, the server logs all statements that change data to the binary
# log, which is used for backup and replication.
# log-bin
# ***** Group Replication Related *****
# Sets the binary logging format, and can be any one of STATEMENT, ROW,
# or MIXED. ROW is suggested for Group Replication.
# binlog_format
# ***** Group Replication Related *****
# Causes the master to write a checksum for each event in the binary log.
# binlog_checksum supports the values NONE (disabled) and CRC32.
# The default is CRC32. When disabled (value NONE), the server verifies
# that it is writing only complete events to the binary log by writing
# and checking the event length (rather than a checksum) for each event.
# NONE must be used with Group Replication.
# binlog_checksum
# ***** Group Replication Related *****
# The base name for the relay log. The server creates relay log files in
# sequence by adding a numeric suffix to the base name. If you specify this
# option, the value specified is also used as the base name for the relay log
# index file. Relay logs increase speed by using load-balancing between disks.
relay_log="PC-20140-relay"
# ***** Group Replication Related *****
# Specifies the server ID. For servers that are used in a replication topology,
# you must specify a unique server ID for each replication server, in the
# range from 1 to 2^32 − 1. “Unique” means that each ID must be different
# from every other ID in use by any other replication master or slave.
server-id=1
# ***** Group Replication Related *****
# The host name or IP address of the slave to be reported to the master
# during slave registration. This value appears in the output of SHOW SLAVE HOSTS
# on the master server. Leave the value unset if you do not want the slave to
# register itself with the master.
# report_host=0.0
# ***** Group Replication Related *****
# The TCP/IP port number for connecting to the slave, to be reported to the master during
# slave registration. Set this only if the slave is listening on a nondefault port or if
# you have a special tunnel from the master or other clients to the slave.
report_port=3306
# ***** Group Replication Related *****
# This option specifies whether global transaction identifiers (GTIDs) are
# used to identify transactions. ON must be used with Group Replication.
# gtid_mode
# ***** Group Replication Related *****
# When enabled, the server enforces GTID consistency by allowing execution of
# only statements that can be safely logged using a GTID. You must set this
# option to ON before enabling GTID based replication.
# enforce_gtid_consistency
# ***** Group Replication Related *****
# Whether updates received by a slave server from a master server should be
# logged to the slave's own binary log. Binary logging must be enabled on
# the slave for this variable to have any effect. ON must be used with
# Group Replication.
# log_slave_updates
# ***** Group Replication Related *****
# Determines whether the slave server logs master status and connection information
# to an InnoDB table in the mysql database, or to a file in the data directory.
# The TABLE setting is required when multiple replication channels are configured.
# master_info_repository
# ***** Group Replication Related *****
# Determines whether the slave server logs its position in the relay logs to an InnoDB
# table in the mysql database, or to a file in the data directory. The TABLE setting is
# required when multiple replication channels are configured.
# relay_log_info_repository
# ***** Group Replication Related *****
# Defines the algorithm used to hash the writes extracted during a transaction. If you
# are using Group Replication, this variable must be set to XXHASH64 because the process
# of extracting the writes from a transaction is required for conflict detection on all
# group members.
# transaction_write_set_extraction
lower_case_table_names=1
# Secure File Priv.
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=151
# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable "open-files-limit" in
# section [mysqld_safe]
table_open_cache=2000
# Maximum size for internal (in-memory) temporary tables. If a table
# grows larger than this value, it is automatically converted to disk
# based table This limitation is for a single table. There can be many
# of them.
tmp_table_size=80M
windowsサービスでmysql57を再起動した後接続できなくなります。
mysql自体が立ち上がってないようですので、iniファイルに何か問題がないかと睨めっこしています・・・
是非お力添えをお願いしたいですm(__)m
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
0
ちなみに、MySQLのプロセスが生き残り続けてるかどうかは、
以下のコマンドをコマンドプロンプトで実行することでも確認できます。
※「mysql -u root」等でmysqlのクライアントで接続したままのcmdがある場合は、閉じてから行ってください。
「netstat -n | find ":3306"」
※MySQLのデフォルトのポート番号が3306。変更している場合は数字を変えてください。
このコマンドで何も表示されなければ、そのポートは使用されていないのでMySQLのプロセスはないはずです。
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.20%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
質問への追記・修正、ベストアンサー選択の依頼
yoorwm
2019/11/01 10:17
> mysql自体が立ち上がってないようですので、iniファイルに何か問題がないかと睨めっこしています・・・
このように書いておきながら、iniファイルが記載されていないのはなぜでしょうか?
退会済みユーザー
2019/11/01 10:28
文字数制限で記入出来ませんでしたm(__)m
LineOfLightning
2019/11/01 10:43
どのような設定でインストールしたか、インストールした後にどのような作業をしたか細かくわからないので質問します。
・my.iniからdefault-time-zone = 'Japan'を消した場合はサービスから起動できますか?
・コマンドプロンプトから手動では起動できますか?
退会済みユーザー
2019/11/01 10:51
default-time-zone = 'Japan'を消して更新しても開始中のままです。
手動でもできないです・・
LineOfLightning
2019/11/01 10:58
手動でもできないってことは、サービスだからどうこうとは関係ないですね。
考えられることは2つ
・mysqlの起動 or シャットダウンに失敗して、mysqlのプロセスが居残り続けており、リソース(ポート等)が使えないので起動に失敗してしまう
・my.ini等の設定、データ等がおかしくて起動できなくなってしまっている
前者かどうか切り分けるために、タスクマネージャーでmysqlが動いていないか確認してmysql関連全て終了させる or Windowsの再起動をしてみてください。
後者の場合、データ等に未練がなければ、mysqlを再インストールをお勧めします。
ちなみに、timezoneですが、自分でJapanというタイムゾーンをtime_zoneテーブルに追加したんですよね?
退会済みユーザー
2019/11/01 11:16
タスクマネージャではmysql.exeとmysqlNotifier.exeのタスクを切ってみましたが状況は変わりませんでした。
再インストールは2度しましたが、毎度同じタイミングで停止してしまっています。
タイムゾーンのテーブルは作っていないです・・・
timezone_posixの中身をcmdにコピペしました。
LineOfLightning
2019/11/01 11:41
>timezone_posixの中身をcmdにコピペしました。
「mysql -u root -p mysql < C:\****\timezone_posix.sql」のようなコマンドですか?
そうであれば、大丈夫です。Japanも作成されているはずです。
mysql.exeはクライアントのプロセスです「mysql -u root」等で接続している奴そのものです。
mysqld.exeというプロセスはありませんでしたか?
再インストールしても駄目な場合、プロセスが残ってる可能性が高いのですが・・・。
Mysqlを再インストール(Mysqlをアンインストール&インストール)し、その後にWindowsを再起動してみてください。
退会済みユーザー
2019/11/01 12:05
timezone_posixmの中身を確認したところ自動でテーブルを作成してくれているみたいでした。
mysqldはなかったと思います。
タスクを切ってから、cmdからremove
→プログラムの追加削除から、mysql serverを最初に、残りすべてをアンインストール
→programFileとprogramDataのmysqlフォルダを削除
これでプロセスを残さずに再インストールできそうですかね・・・
今セコセコアンインストールしています