I logged into the mysql from the command line using the following command and in addition to that I was trying to import the sql file into the database as follows in the same line:
[username@abc-xyz web_app]$ mysql -u root -pmypassword -Dtestdb < TestDB.sql
Where, testdb is the name of the database.
Note: web_app is the folder where I have my TestDB.sql file present which I want to import it into the database.
After running the above command, nothing happens but I see a warning :
Warning: Using a password on the command line interface can be insecure.
I was a bit confused when I first got that one myself.
I guess the logic behind it is that someone could look over my shoulder and see it?
Anyway, try the same command using only “-p” without the password after it.
You should then get a prompt for Enter password:
where what you enter will be displayed as asterisks.
Thanks for your reply. I did what you said and it did ask me to enter password Enter password. When I entered the password, it didn’t show asterisks and everything was blank. So I entered my password and I got the prompt [username@abc-xyz web_app]$ again.
Secondly, I can successfully get the mysql prompt using the following command [username@abc-xyz web_app]$ mysql -u root -pmypassword. So password seems to be working here.
The problem I am having here is trying to figure out how to import the sql file into the database testdb
Thanks, the original command [username@abc-xyz web_app]$ mysql -u root -pmypassword -Dtestdb < TestDB.sql worked for me for some reason which wasn’t working yesterday.