MySQL skip grant tables add user error 1290
I forgot the database password,
At this time, we just need to add the
skip-grant-tables
Then restart the service and log in to the database without us entering the password
At this time, I successfully log in to the database, but I accidentally deleted all the users and couldn’t log in. At this time, I changed the configuration file to log in. I wanted to add users to the database, but after executing the add user command, I was prompted as follows:
ERROR 1290 (HY000): The MySQL server is running with the –skip-grant-tables option so it cannot execute this statement
mysql> GRANT ALL PRIVILEGES ON *.* TO IDENTIFIED BY ‘123’ WITH GRANT OPTION;
ERROR 1290 (HY000): The MySQL server is running with the –skip-grant-tables option so it cannot execute this statement
At this time, we just need to flush privileges to add users,
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO IDENTIFIED BY ‘123’ WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
At this time, we have successfully completed, and then log in.
If an error is reported, the following information is given:
Error: Cannot retrieve repository metadata ( repomd.xml ) for repository: InstallMedia. Please verify its path and try again
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest
We just need to get to/etc/ yum.repo . s packetxxxx.repo and RedHat.repo Delete the two files and start again,