I have to execute MySQL command without entering the MySQL prompt any interaction. For this I have to specify password at command-line , such as
mysql -u 'user' -p'password' command;
Though my user which is root is not having password (checked in mysql.user table) I am unable to use it for running the MySQL commands at commandline and not entering prompt.
I have tried using below things:
mysql -u root 'followed by query'
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
mysql -u root -p 'followed by query'
Prompts for password and when I just press enter it goes into prompt.
Please suggest how to execute this without any interaction (Using Enter key).
mysql -u root -p? right?