Forget mysql password, timezone error


Forgetting my sql password 

service mysql start, should be done before entering the mysql.
 
If i forget my password, i can enter without password like this:
 
Changint the file my.cnf (in my Ubuntu-system he is placed at /etc/mysql/my.cnf). In the end i added that code:
 
[mysqld] 
skip-grant-tables
 
Then run mysql server after adding it.
Before running change the permission of the file my.cnf, with chmod 0444 my.cnf 
 
mysql -u root 

After entering into the mysql, the way to change password depends on the version of mysql server.
For 8.0 or greater version this is the way,
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password'; 
 
This is the link to change password if i forget password: except for the line update, i have to use alter.

After changing the password, delete the added line in my.cnf 

Time zone error

use this url sample for time zone error
jdbc:mysql://localhost:3306/bookstoredatabase?serverTimezone=UTC 

serverTimezone=MST 


 

Comments

Popular posts from this blog

Error and solution, or solution.