• Register
0 votes
106 views

Problem :

I am very new to the Linux but want to set up my MySQL databases on the Amazon ec2 instance. I have followed some directions I found about resetting a user login pass by using a --skip-grant-tables option of the MySQL. Now I want to add my user and unable to figure out now how to turn the option off.

This is what I want to do:

mysql> GRANT CREATE,SELECT,INSERT,UPDATE,DELETE ON ...my db username and pass

However I face below error:

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

How can I turn above option off?

7 5 2
3,870 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

You need to just login to mysql

 mysql -u root -p

After that execute below command:

flush-privileges;

If this doesn't work then execute below command:

FLUSH PRIVILEGES;

 OR

You can make this done just by using the below steps.

[root@backups1 mysql5.7]# bin/mysqld_safe --skip-grant-tables --user=mysql

Need to connect to your mysql without the password and execute below commands:

mysql> flush privileges;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '';
mysql> flush privileges;

Now just switch to the normal mode of mysql then connect without password.

I hope this will work for you.

9 7 4
38,600 points

Related questions

0 votes
1 answer 326 views
326 views
Problem : I am facing a strange MySQL error may be it is related to the database's read-only flag. The Web application that is using the MySQL is running on Debian 7.9. It was running well but suddenly started attempting to access the application powered website ... - SQLSTATE[HY000]: General error: 1290 The MySQL server is running with the --read-only option so it cannot execute this statement
asked Nov 20, 2019 peterlaw 6.9k points
0 votes
1 answer 158 views
158 views
Problem : I get mysql error help the mysql server is running with the --secure-file-priv option so it cannot execute this statement
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 61 views
61 views
Problem : After I tried to update my Docker version to 0.8.0, I face an error message while I try to enter sudo docker version as below : Client version: 0.8.0 Go version (client): go1.2 Git commit (client): cc3a8c8 2020 ... 12:55:57 initserver: open /var/lib/docker/aufs/layers/cf2414da53f9bcfaa48bc3d58360d7f1cfd3784e4fe51fbef95197709dfc285d: no such file or directory How can I resolve the issue?
asked Jan 3, 2020 alecxe 7.5k points
0 votes
1 answer 71 views
71 views
Problem : My problem kicked off when I was unable to log in as the root any more on the mysql install. I was trying to run mysql without the passwords turned on however when I ran my below command : # mysqld_safe --skip-grant-tables & I never got my prompt back. ... socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
asked Jan 4, 2020 alecxe 7.5k points
0 votes
1 answer 43 views
43 views
Problem : My problem started with me when I was unable to log in as root any more on the mysql install. I was trying to run mysql without passwords turned on... but whenever I ran the below command # mysqld_safe --skip-grant-tables & I would never get my prompt back ... socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
asked Dec 27, 2019 alecxe 7.5k points
0 votes
2 answers 150 views
150 views
Problem : I am trying to load my data into mysql database using below code LOAD DATA LOCAL INFILE A.txt INTO DB LINES TERMINATED BY '|'; A topic of my question is related to response I get. I understand a local data offloading is off by default and I have to enable it using following command local-infile=1 but I do not know how to execute this command.
asked Jan 28, 2020 jwilliam 3.9k points
1 vote
1 answer 158 views
158 views
Problem : Facing the weird following issue cannot connect to the docker daemon at unix:///var/run/docker.sock. is the docker daemon running?
asked Nov 8, 2019 peterlaw 6.9k points
1 vote
1 answer 134 views
134 views
Problem : Encountered bellow docker error cannot connect to the docker daemon at unix:///var/run/docker.sock. is the docker daemon running?
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 10 views
10 views
Problem: I recently copied my mysql database to a new data directory and changed a few settings. I also accidentally deleted my / home / user directory and enjoyed recreating the fair. Now I can connect to mysql from the command line, but I cannot connect via phpMyAdmin. I ... phpto: $cfg['Servers'][$i]['host'] = '127.0.0.1'; // previously 'localhost' I also tried unsuccessfully FLUSH PRIVILEGE.
asked Dec 30, 2020 sasha 5.3k points