1

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.

Please let me know what am I doing wrong?

John
  • 163
  • 3
  • 11
  • Look here: http://stackoverflow.com/questions/20751352/suppress-warning-messages-using-mysql-from-within-terminal-but-password-written – IT Thug Ninja Jan 12 '17 at 16:45
  • @ITSolutions Thanks but my question is not related with suppressing warnings. – John Jan 12 '17 at 16:47
  • I thought you were just trying to get it to work but it appears in later releases of MYSQL that this may just be the default behavior in the name of making functionality more secure. Are you looking for an answer to a specific question other than "why is this happening" or "how can I get this to work as-is with a workaround to the new security enforcement of mysql from command line"? – IT Thug Ninja Jan 12 '17 at 16:50
  • @ITSolutions The file is not getting imported with this command [username@abc-xyz web_app]$ mysql -u root -pmypassword -Dtestdb < TestDB.sql – John Jan 12 '17 at 16:51
  • Exactly, so you cannot embed the password into the command line and pass it as an argument with the -p switch in cleartext apparently with the version of mysql you are using. If you look at the answers on the post I provided rather than the question title only, etc. then you will see why and how to fix. I provided the post so you could look through it all (not just the question which I did not even pay attention too). – IT Thug Ninja Jan 12 '17 at 16:54
  • @ITSolutions I can get to the mysql prompt using the following command mysql -u root -pmypassword so I don't thing it's password related issue. – John Jan 12 '17 at 17:00

0 Answers0