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:
-
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 -
Make sure that mysql-dist-5.7.14-windows-amd64\data folder is empty
-
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
-
This step generates a temporary password at: mysql-dist-5.7.14-windows-amd64\data<machinename>.err file. Make a note of that password.
-
On another thread, start a mysqld process & leave that running.
-
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 -
You will get logged into the MySQL. Type this:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password'; -
The last step changes the password. Preferrable set it to "root" password.
-
In addition create a database using the command:
mysql> Create Database test; -
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