trying to run mysql in ubuntu
typing mysql
in terminal
and getting error
ERROR 1045(28000): Access denied for user 'root'@'localhost' (using password: NO)
Can anybody please sort out this problem...
You have to give a valid username. For example, to run query with user root
you have to type the following command and then enter password when prompted:
mysql -u root -p
Once you are connected, prompt will be something like:
mysql>
Here you can write your query, after database selection, for example:
mysql> USE your_database;
mysql> SELECT * FROM your_table;
If you want to run your scripts, then
mysql -u root -p < yourscript.sql
You need to log in with the correct username and password. Does the user root have permission to access the database? or did you create a specific user to do this?
The other issue might be that you are not using a password when trying to log in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With