Results 1 to 5 of 5
-
05-19-2009, 05:34 AM #1WHT Addict
- Join Date
- Jun 2008
- Posts
- 100
How to import mysql dump file to database by SSH
Hello,
How to import mysql dump file to database by SSH?
How to import mysql database host to other host database by SSH?
Thanks.
-
05-19-2009, 05:55 AM #2Newbie
- Join Date
- Apr 2009
- Location
- Guildford, Surrey, UK
- Posts
- 12
You should just be able to do:
Code:mysql -u <username> -p<password> mysql_database < mysql_database_dump.sql
Not entirely sure what you mean by the second question - are you wanting to allow other hosts to access the database already defined somewhere else?
M.Systems Administrator
Memset Dedicated Hosting
PC Pro's Best Web Host four years running!
http://www.memset.com
-
05-19-2009, 06:02 AM #3The Linux Specialist
- Join Date
- Mar 2003
- Location
- /root
- Posts
- 23,990
Moved > Technical & Security Issues.
Specially 4 U
Reseller Hosting: Boost Your Websites | Fully Managed KVM VPS: 3.20 - 5.00 Ghz, Pure Dedicated Power
JoneSolutions.Com is on the net 24/7 providing stable and reliable web hosting solutions, server management and services since 2001
Debian|Ubuntu|cPanel|DirectAdmin|Enhance|Webuzo|Acronis|Estela|BitNinja|Nginx
-
05-19-2009, 07:03 AM #4Junior Guru Wannabe
- Join Date
- Mar 2009
- Posts
- 75
Hello,
I have the answers for your two questions.
How to import mysql dump file to database by SSH?
You can use the below command from command prompt to access the database locally and to dump the dump file to the database.
mysql -u <username> -p<password> mysql_database <
mysql_database_dump.sql
For this to happen you have to enable the particular host in your server to allow the mysql connection.You can do it from the mysql configuration file /etc/my.cnf to make any particular host to access the databases or else you can grant privilege to that remote host user to access your database.
The command you have to use is shown below:-
mysql -h <server IP> -u <username> -p<password> mysql_database <
mysql_database_dump.sql
Please try this and you will be successful.
-
05-19-2009, 08:52 AM #5WHT Addict
- Join Date
- Jun 2008
- Posts
- 100
mbdrake, jai_hoo, net
Thanks.