How to IMPORT MySQL database using SSH in Kloxo On VPS ??

liunx

Guest
How to IMPORT MySQL database using SSH in Kloxo On VPS ??
facepalm.gif
Code: mysql -u username -p database_name < dumpfile.sqlUse that Awesome useful tool, I have coded a ssh script once before because I could never remember the correct syntax.

Code: echo "MySQL Username"read usernameecho "MySQL Database"read databaseecho "MySQL File"read filemysql -u $username -p $database < $fileCopy and Paste, save as: mysqlimport.sh - chmod +x 755 and sh mysqlimport.sh and follow the onscreen prompts, I should update my easy ssh tools. Quote: Originally Posted by Forgiven Code: mysql -u username -p database_name < dumpfile.sqlUse that
i try that but its not working... You have to be in the same directory as the file. it should be

mysql -uusername -pdatabase_name < dumpfile.sql And the error is? Quote: Originally Posted by Lifetalk And the error is? No such files directories
i give with this also home/admin/my directories. Quote: Originally Posted by Dj Mad it should be

mysql -uusername -pdatabase_name < dumpfile.sql That syntax is wrong. There's a space between -u and the username. There is, however, no space between -p and the password (or the password can be left blank and entered at the prompt that follows).


@OP
cd to the directory where the .sql file is hosted, then run the command I don't think it matters, I've used the first syntax and the ones without spaces and they all tend to work.
 
Top