A more complete question, part of which was asked: Part of the topic here!

I tried all the options, example:

1.mysql-init.txt -> contains: UPDATE mysql.user SET Password = PASSWORD ('pl00000') WHERE User = 'root'; FLUSH PRIVILEGES;

2. mysqld --defaults-file = "C: \ Program Files (x86) \ MySQL \ MySQL Server5.7 \ my.ini" --init-file = C: \ Users \ Maks1988 \ Desktop \ mysql-init.txt

mysqld: [ERROR] Could not open required defaults file: C: \ Program Files (x86) \ MySQL \ MySQL Server 5.7 \ my.ini mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

3.mysqld GRANT ALL PRIVILEGES ON . TO 'root' @ 'localhost' IDENTIFIED BY 'pl00000' WITH GRANT OPTION; FLUSH PRIVILEGES; Does not help!

4.C: \ Program Files (x86) \ MySQL \ MySQL Server 5.7 \ bin> mysqld.exe --default-file = "my.ini" --init-file = "C: \ Users \ Maks \ Desktop \ mysql -init.txt "- console

2016-08-01T22: 37: 56.684944Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-08-01T22: 37: 56.684944Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict the location of the generated files. Consider setting it to a valid, non-empty path. 2016-08-01T22: 37: 56.684944Z 0 [Note] mysqld.exe (mysqld 5.7.11) starting as process 2716 ... 2016-08-01T22: 37: 56.869061Z 0 [ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if there is a keyring_file_data points to be created. The keyring_file will stay unusable until it corrects the keyring file gets provided '2016-08-01T22: 37: 57.927220Z 0 [Note] InnoDB: Loading buffer pool (s) from C: \ Program Files (x86) \ MySQL \ MySQL Server 5.7 \ data \ ib_buffer_pool mysqld: Table 'mysql.plugin' does not exist 2016-08-01T22: 37: 57.942217Z 0 [Note] InnoDB: Buffer pool (s) load completed at 160802 1:37:57 2016- 08-01T22: 37: 57.951790Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 2016-08-01T22: 37: 57.968790Z 0 [ERROR] unknown variable 'default-file = my.ini' 2016-08-01T22: 37: 57.974791Z 0 [ERROR] Aborting

5.mysql.exe --init-file = C: \ Users \ Maks1988 \ Desktop \ mysql-init.txt

mysql: [ERROR] unknown variable 'init-file = C: \ Users \ Maks1988 \ Desktop \ mysql-init.txt'

enter image description here

  • I will be glad to any help!

  • Another script, the same error ( java.sql.SQLException: Access denied for user 'user = root' @ 'localhost' (using password: YES) )

  • SET PASSWORD FOR 'root' @ 'localhost' = PASSWORD ('MyNewPass'); FLUSH PRIVILEGES; This line allows you to change the password to log in via cmd in mysql, but when I try to connect with the same password through Realm JDBC I get an error! java.sql.SQLException: Access denied for user 'user = root' @ 'localhost' (using password: YES)
  • I'll shoot you soon! What could be the problem?

enter image description here

<Realm className="org.apache.catalina.realm.JDBCRealm" driverName="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/coupon_system" connectionName="user=root" connectionPassword="password=Maks1988" userTable="user" userNameCol="nickname" userCredCol="password" userRoleTable="user_roles" roleNameCol="role"/> </Realm> 
  • And why on the image of the file is called my-ini, and not my.ini? - cheops
  • Renamed! Thank. Does not help - Maks.Burkov
  • The first time I see such instructions for work. Where is the server stop, where is the start with skipping the user table to reset. Login to the shell with an empty password. ashep.org/2010/sbros-parolya-root-v-mysql as an example of what should be. For Windows zonepc.ru/sbros-parolya-mysql-pod-windows - Igor
  • @Igor: I don’t have mysqld-nt.exe in the folder! - Maks.Burkov
  • @Igor: I used this command -> SET PASSWORD FOR 'root' @ 'localhost' = PASSWORD ('MyNewPass'); Same logic? - Maks.Burkov

1 answer 1

If you forgot the Root password from MySQL , and want to delete it, I know one working method. Only there is one drawback, your databases will not be there ..

  1. This will uninstall MySQL Server
  2. delete all contents of the C: / ProgramData / MySQL folder
  3. Then reinstall MySQL Server again

Then they will require a ROOT password during installation, and I advise you to write something down on a piece of paper .. so as not to forget later.

  • one
    Let's try. As for the password root, I remember everything is fine. I wrote that through the shell it turns out to go, and through the JDBBC Realm throws an error with the same password! - Maks.Burkov
  • C: / ProgramData / MySQL I do not have such a folder! - Maks.Burkov
  • This folder is hidden) - E1mir
  • @ Maks.Burkov beat him in the conductor) and all) - E1mir
  • @ Maks.Burkov what exactly? Do not know how to make a hidden folder visible? - E1mir