web-dev-qa-db-ja.com

権限テーブルを開いてロックできません:テーブル 'mysql.user'が存在しません-myslqの2番目のインスタンスを実行しようとしています

Win7ボックス。

Mysql-5.7.9をダウンロードし、すでに実行中の古いバージョンの別のインスタンスと一緒に、それ自体の自己完結インスタンスとして実行しようとしました。

私はこのコマンドで新しいサービスをインストールしました:

"C:\mysql-5.7.9\bin\mysqld.exe" --install mysql579 --defaults-file="C:\mysql-5.7.9\bin\my.cnf"

My.cnfは次のとおりです。

[client] 
port            = 3307 
socket          = mysql579

[mysqld] 
basedir="C:/mysql-5.7.9"
tmpdir="C:/mysql-5.7.9/tmp" 
datadir="C:/mysql-5.7.9/data" 

port            = 3307 
socket          = mysql579

character-set-server = latin1
collation-server = latin1_general_ci

server-id   = 2

[WinMySQLadmin] 
Server="C:/mysql-5.7.9/bin/mysqld.exe"

これが私のトラブルシューティングの正しいコマンドであるかどうかはわかりません。自分のオプションファイルを使用しているとは思わないためですが、これはC:\mysql-5.7.9\bin>mysqld.exe --defaults-file="C:\mysql-5.7.9\bin\my.cnf" --standalone --consoleを実行したときに表示されるものです

2015-12-16T20:59:53.098442Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server optio
n (see documentation for more details).
2015-12-16T20:59:53.098442Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Co
nsider setting it to a valid, non-empty path.
2015-12-16T20:59:53.098442Z 0 [Note] mysqld.exe (mysqld 5.7.9) starting as process 68544 ...
2015-12-16T20:59:53.114042Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-12-16T20:59:53.114042Z 0 [Note] InnoDB: Uses event mutexes
2015-12-16T20:59:53.114042Z 0 [Note] InnoDB: Memory barrier is not used
2015-12-16T20:59:53.114042Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-12-16T20:59:53.114042Z 0 [Note] InnoDB: Number of pools: 1
2015-12-16T20:59:53.114042Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2015-12-16T20:59:53.145242Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2015-12-16T20:59:53.160842Z 0 [Note] InnoDB: Completed initialization of buffer pool
2015-12-16T20:59:53.238843Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2015-12-16T20:59:53.441644Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2015-12-16T20:59:53.441644Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2015-12-16T20:59:53.628845Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2015-12-16T20:59:53.628845Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2015-12-16T20:59:53.628845Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2015-12-16T20:59:53.628845Z 0 [Note] InnoDB: 5.7.9 started; log sequence number 1210148
2015-12-16T20:59:53.628845Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\mysql-5.7.9\data\ib_buffer_pool
2015-12-16T20:59:53.628845Z 0 [Note] Plugin 'FEDERATED' is disabled.
2015-12-16T20:59:53.628845Z 0 [Note] InnoDB: not started
mysqld: Table 'mysql.plugin' doesn't exist
2015-12-16T20:59:53.628845Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2015-12-16T20:59:53.628845Z 0 [Note] InnoDB: Buffer pool(s) load completed at 151216 15:59:53
2015-12-16T20:59:53.628845Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2015-12-16T20:59:53.628845Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate
 and private key
2015-12-16T20:59:53.628845Z 0 [Note] Server hostname (bind-address): '*'; port: 3307
2015-12-16T20:59:53.644445Z 0 [Note] IPv6 is available.
2015-12-16T20:59:53.644445Z 0 [Note]   - '::' resolves to '::';
2015-12-16T20:59:53.644445Z 0 [Note] Server socket created on IP: '::'.
2015-12-16T20:59:53.644445Z 0 [Warning] Failed to open optimizer cost constant tables

2015-12-16T20:59:53.644445Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2015-12-16T20:59:53.644445Z 0 [ERROR] Aborting

2015-12-16T20:59:53.644445Z 0 [Note] Binlog end
2015-12-16T20:59:53.644445Z 0 [Note] Shutting down plugin 'ngram'
...
7
red888

今晩同じ問題が発生し、新しいMySQLサーバーをセットアップしました。 MySQLが5.7.7以降、初期データを提供しないことを知りませんでした(比較 MySQL 5.7リファレンス-2.3.5.4データディレクトリの初期化 )。同じエラーが発生するため、既存のデータ(初期化済みアカウント)がないと思いますので、実行してみてください

mysqld --initialize --console
13
Norman Rothe