![]() |
|||
PHP
IT Tags
Mobile site Xampp XHTML connection to MYSQL server shutdown sdf magento ecommerce Solr XML my_thread_global_end UPDATE check domain Simplexml Parser Combo box local server Overlapping Layers photo gallery SimpleXML PHP and FLash multiple file uplo indexing solr include associative arrays Stop Script ajax objects mysql server Remove Duplicate php mail control panel local server |
Importing SQL files from SSH
By: rekha singh | 25 May 2010 11:36 am
I'm trying to import a SQL file full of UPDATE statements to my database. My web host is absolutely no help at all. I've done this before and someone helped me find a command that worked. But four months later, I've obviously forgotten. This is what they're suggesting that I use: mysql -p -u username database_name < file.sql
So, I log in, cd to the directory where the file is stored, and run the above command. It asks for my password and nothing happens.
Am I doing something wrong?
CommentsAre you trying to move or copy a database from one machine to another? If so this may help -
to back up or transfer a database
open terminal window
$ mysqldump -u username - p databasename > backupfilename.sql
type password when prompted
to install on another pc
copy the file across
open terminal window
cd to directory containing the file
$ mysql -u username -p
type password when prompted
mysql> use databasename;
note - if the database does not exist you need to create it with
mysql> create database databasename;
mysql> source backupfilename.sql;
this will create all tables, views and load all of the data from the old database
Hope that helps
By: rekha singh | 25 May 2010
|
