Linux / UNIX Tech Support Forum
This is a discussion on ssh backup particular mysql table / database within the Databases servers forums, part of the Mastering Servers category; I know nothing guys I really need help with this one I googled and google and I am tired please ...
|
|||||||
| Databases servers Discussions of databases of all types - especially MySQL. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I know nothing guys I really need help with this one I googled and google and I am tired please help
I have a database with many many tables I want only to use ssh and backup all tables starting with phpbb_ into my public_html Please let me know the commands I should use! |
| Sponsored Links | ||
|
|
|
||||
|
Use mysqldump to backup entire database
Code:
mysqldump -u root -p dbname > backup.db.sql
__________________
Vivek Gite Linux Evangelist |
|
||||
|
Just take a look at the help (mysqldump --help). The --tables option should do the trick.
__________________
teh.geekosphere.org |
|
||||
|
Code:
mysqldump -u USER -p DATABASE --tables TABLE > TARGET.sql
__________________
teh.geekosphere.org |
|
||||
|
Try something as follows (set db name, username and password)
Code:
#!/bin/bash DBNAME="phpbb" DBPASS="myPassWord" DBUSER="admin" DBHOST="localhost" BACKUP="out.sql" >$BACKUP echo "" echo -n "*** Dumping tables to $BACKUP file : " TABLES=$(mysql -ss -h $DBHOST -u $DBUSER -p$DBPASS $DBNANE -e'show tables like "phpbb_%";') for t in $TABLES do echo -n " $t " mysqldump -h $DBHOST -u $DBUSER -p $DBPASS $DBNAME --tables "$t" >> $BACKUP done echo " *** Done."
__________________
Vivek Gite Linux Evangelist |
|
|||
|
So do you mean I make a php script and run it?
sorry I have no Idea! OK supposing this is my info Db name: brothers db password: 1234 dbuser: Me Dbhost: local host and I want to download all tables starting with phpbb2_ ====================================== I want to backup my phpbb2 forum from among 500 of other tables which are not related and make a new database and restore it there |
|
||||
|
This is a shell script, it will not work from PHP until and unless you have shell access from your domain. If you have shell access it will work out.
If you don't have shell access get phpMyAdmin software upload the same and use export option select phpbb_ tables and download them to your local computer or to directory. Download : phpMyAdmin | MySQL Database Administration Tool | www.phpmyadmin.net See how to backup tables with this software : WordPress Backup with phpMyAdmin Another option is use phpbb's own backup and restore table option. Keeping in mind that if your tables are quite big, php may not work on shared hosting account due to restrictions. Hope this helps!
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to do MYSQL online backup of huge database | manish_2479 | Databases servers | 4 | 12-07-2008 12:36 PM |
| need to convert text files into mysql database | zafar466 | Databases servers | 2 | 12-07-2008 12:31 PM |
| MySql FTP server backup script | zafar466 | Shell scripting | 3 | 25-09-2007 05:43 PM |
| MySQL Backup Script | krisa | Shell scripting | 1 | 02-02-2007 11:57 PM |
| How do I backup MySQL Databases? | chiku | All about FreeBSD/OpenBSD/NetBSD | 2 | 19-08-2006 07:15 PM |