jcabi / jcabi-mysql-maven-plugin

MySQL Maven Plugin: starts MySQL server on pre-integration phase and shuts it down on post-integration phase

Home Page:https://mysql.jcabi.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of mysql-install-db.pl is deprecated as of 5.7.6

shrutiujjwal opened this issue · comments

The use of mysql-install-db.pl is deprecated as of 5.7.6. This code base will be have to be refactored to address the needs & make it compatible with 5.7.x MySQL.

Refer article: http://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysql-install-db.html

Steps to do it manually, that will need to be converted to Java Code:

  1. Say we have a MySQL distribution extracted as folder in:
    C:\Perforce_Workspace\developer-local-repository\com\jcabi\mysql-dist\5.7.14\mysql-dist-5.7.14-windows-amd64

  2. Make sure that mysql-dist-5.7.14-windows-amd64\data folder is empty

  3. Then on a command window navigate to that folder & type in the following command:
    C:\Perforce_Workspace\developer-local-repository\com\jcabi\mysql-dist\5.7.14\mysql-dist-5.7.14-windows-amd64\bin>mysqld --initialize --user=mysql

--basedir=C:\Perforce_Workspace\de
veloper-local-repository\com\jcabi\mysql-dist\5.7.14\mysql-dist-5.7.14-windows-amd64 --datadir=C:\Perforce_Workspace\developer-local-repository

\com\jcabi\mysql-dist\5.7.14\mysql-dist-5.7.14-windows-amd64/data --ignore-db-dir

  1. This step generates a temporary password at: mysql-dist-5.7.14-windows-amd64\data<machinename>.err file. Make a note of that password.

  2. On another thread, start a mysqld process & leave that running.

  3. Now from the mysql-dist-5.7.14-windows-amd64\bin folder type the following command:
    mysql -u root -p
    Enter password: <enter the password you had noted earlier

  4. You will get logged into the MySQL. Type this:
    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

  5. The last step changes the password. Preferrable set it to "root" password.

  6. In addition create a database using the command:
    mysql> Create Database test;

  7. Now you can connect to this code using the java code & perform any necessary operation.

@yegor256 please dispatch this issue

@shrutiujjwal would you be interested to contribute with a pull request?

@shrutiujjwal this is fixed in the latest version