Inserting mysql database using shh putty
I've down loaded mysql database file and now I'm looking at adding it into a new dedicated server.
Should I upload that sql file to the root folder I created for the domain and insert it with shh like that? If not where should I upload this mysql file to insert it to the new database. It's rather large so I have to use SHH Fir example if this is the code, Code:
mysql -uUSERNAME -pPASSWORD DATABASENAME < MYDATABASE.sql Thanks, Brian |
wherever you like ... the "<" character is just a shell redirection, meaning it "feeds" the file "MYDATABASE.sql" as input to the command mysql. You can delete the original file after command execution, mysql stores the contents in its database files.
|
ok so I'm sitting here connected with putty to my new server. I haven't added any domains yet. I'm about to add my first domain name and the system will create it's database etc for me. Where do I upload this MYDATABASE.sql so I can insert it to the new database? Do I upload it in the new domain nanes root folder?
if so what would be my path public_html/MYDATABASE.sql |
Well, if you want to upload that SQL to your server, you'll have to use scp, ftp or sftp!
|
Yes I have an ftp program. So to confirm I upload it to the root public_html folder for this specific domain and use
Code:
mysql -uUSERNAME -pPASSWORD DATABASENAME < public_html/MYDATABASE.sql |
you upload it WHEREEVER YOU WANT, it doesn't matter. As I said, you can delete the file after importing it
|
I uploaded it to the root of this new domain which I think is /public_html/ when I used the code inside putty,
mysql -uUSERNAME -pPASSWORD DATABASENAME < public_html/MYDATABASE.sql it says no such file or directory. I'm logged in as root using putty |
Your problem is the "I think" in the opening line of post #7
Try to find the file first using the find command Code:
fortyfourgalena@desktop1:~$ find . -name "mini*" -print |
Code:
find / -iname MYDATABASE.sql -print Either cd to that dir or use the full absolute path. |
All times are GMT -5. The time now is 06:33 PM. |