Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql server 8.0 keyring migration error at login

Tags:

mysql

windows

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?

like image 633
Nick Liu Avatar asked Jul 20 '18 19:07

Nick Liu


2 Answers

  1. After Installation on Windows. Look for the path to the installed folder.

    Example:

    C:\Program Files\MySQL\MySQL Server 8.0\bin
    
  2. Open cmd and cd to above path.

  3. 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 you might face an error that says:

    • Unable to create data folder. For this, try specifying the path to data like this:

      mysqld --initialize-insecure
             --basedir=specify your path/mysql/mysql
             --datadir=specify your path/mysql/data
      
    • Or data folder already exist. For this, go to that folder and delete the data folder.

    • Or, for now later versions, in data folder there is already a file exist named my.ini. For this, copy that file and paste it to C:\Program Files\MySQL\MySQL Server 8.0\ (you can do more changes here and specify the path to data and base dir)

  4. Now you have successfully initialized without any password.
    Start the server.

    mysqld --console
    

    NOTE: You could define the path to system environment variable (search on Google on 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
    
  5. Now use command:

    mysql -u root --skip-password
    

    and then

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
    

    This command to set root password.

  6. For the next time use

    mysql -u root -p
    

    And after that enter you new_password

like image 176
yashu vishnalia Avatar answered Nov 13 '22 13:11

yashu vishnalia


Try using mysql -u root -p instead of mysqld - u root -p

like image 6
Ochieng' Avatar answered Nov 13 '22 11:11

Ochieng'