I am somewhat newbie for linux, still learning.
Today I needed to duplicate a database into production environment.. To do this, I used the command
(uiserver):u70486952:~ > mysqldump -h host -u user --password=mypassword dbname > mysql -h host2 -u user2 --password=mypassword dbname2
This command, while looking ok to me did not work and it threw an error.
mysqldump: Got error: 1044: Access denied for user 'user'@'%' to database 'dbname' when selecting the database
Doing this alone (without the > after the command) worked.
I solved this using a pipe character instead of > (more than).
Can someone explain why it showed an errror? I am very curious.
Thank you
Redirection can be performed anywhere in a command, and only the very next word is used as the filename; anything else on the command line is passed as arguments to the command. That is,
is equivalent to