I am using MySQL Server 8.0 on Windows 10. I followed this tutorial to initialize.
C:\Program Files\MySQL\MySQL Server 8.0\bin
λ mysqld --initialize
However, when I try to login with the temporary password, a keyring migration error shows up as below:
C:\Program Files\MySQL\MySQL Server 8.0\bin
λ mysqld -u root -p
Enter password: **********
mysqld: Can not perform keyring migration : Invalid --keyring-migration-source option.
2018-07-20T18:49:20.794197Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.11) starting as process 21312
2018-07-20T18:49:20.801815Z 0 [ERROR] [MY-011084] [Server] Keyring migration failed.
2018-07-20T18:49:20.824651Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-07-20T18:49:20.829415Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.11) MySQL Community Server - GPL.
I did not install any plugins relating to keyring by myself. Is there a way to skip or pass this keyring migration? Thanks in advance.
解决方案
After Installation on windows---> check path-to-installed folder..eg.,C:\Program Files\MySQL\MySQL Server 8.0\bin
open cmd-->cd go to above path
type mysqld --initialize-insecure --console (it will initialize the data folder manually without password to root). For beginners i would suggest this option
mysqld --initialize --console(it will initialize the data folder manually with random password to root)
After this there could be error about
unable to create data folder(try specifying the path to data like this eg..,mysqld --initialize-insecure
--basedir=specify your path/mysql/mysql
--datadir=specify your path/mysql/data)
or data folder already exist(Go there and delete the data folder.)
or for now later versions in data folder there is already a file exist named my.ini copy it and paste it to C:\Program Files\MySQL\MySQL Server 8.0(you could do more changes here and specify the path to data and base dir)
Now you have successfully initialized without any password. Start the server.
mysqld --console
(NOTE: you could define the path to system environment variable(search google how to do it), after that you do not have to go this path every time)
now your server up and running.
mysqld: ready for connections
Version: '8.0.15' socket: '' port: 3306
Now use command --> mysql -u root --skip-password
then
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
this command to set root password.
next time use mysql -u root -p and after that enter you new_password
更多推荐
MySQL生成激活码出错,登录时发生mysql服务器8.0密钥环迁移错误
发布评论