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'
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?
<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>