Can we connect database by terminal by one line. because i'm trying to connect MySQL by terminal from PHP exec()
. Here i want to import one MySQL file so i tried following code but it asks password on execution time. so i need help. I want to connect db in one line with username and password.
mysql -u username -p database_name < file.sql