OK... I think I've found my problem.. I just don't know how to fix it...
I am trying to automate the back up of my mysql database... and then I would like to beable to restore the db vi phpmyadmin.. if needed....
here's a condensed version of the script I use to do the back up....
Code:
# This location is where the backups are saved to disk
LOCATION="/home/someplace/backup"
# This is where your exec file for mysqldump is located.
MYSQLDUMP="/usr/bin/mysqldump"
# This file has all the mysql database names in it.
# Ex. mysql_backup file
#
#
# database_name
#
#
#
MYSQLDBNAME="/home/someplace/mysql_backup"
# Your Mysql user and passwd.
# Rember this account needs access to all databases.
SQLUSER="someuser"
SQLPASS="mypassword"
DATABASES=`cat $MYSQLDBNAME`
for dbname in $DATABASES
do
$MYSQLDUMP -u$SQLUSER -p$SQLPASS ${dbname} > $LOCATION/${dbname}.mysqlbackup
chmod 440 $LOCATION/${dbname}.mysqlbackup
#chown $STAMP $LOCATION/${dbname}.mysqlbackup
done
The first 28 lines are below:
Code:
-- MySQL dump 8.22
--
-- Host: localhost Database: database-name
---------------------------------------------------------
-- Server version 3.23.54
--
-- Table structure for table 'adminblock'
--
CREATE TABLE adminblock (
title varchar(60) default NULL,
content text
) TYPE=MyISAM;
--
-- Dumping data for table 'adminblock'
--
INSERT INTO adminblock VALUES ('Administration Menu','Admin tools for the Web Technology Group\r\n<br /><span class=\"onebiggerred\">></span>\r\n<a href=\"admin.php\">Administration</a>\r\n<br /><span class=\"onebiggerred\">></span>\r\n<a href=\"admin.php?op=logout\">Logout</a>\r\n');
INSERT INTO adminblock VALUES ('Administration Menu','Admin tools for the Web Technology Group\r\n<br /><span class=\"onebiggerred\">></span>\r\n<a href=\"admin.php\">Administration</a>\r\n<br /><span class=\"onebiggerred\">></span>\r\n<a href=\"admin.php?op=logout\">Logout</a>\r\n');
--
-- Table structure for table 'authors'
--
CREATE TABLE authors (.....bla bla bla..........
if I do a back up via phpMyadmin with structure and data... the out put is below...:
Code:
# phpMyAdmin MySQL-Dump
# version 2.2.4
# http://phpwizard.net/phpMyAdmin/
# http://phpmyadmin.sourceforge.net/ (download page)
#
# Host: localhost
# Generation Time: Jan 23, 2003 at 09:55 AM
# Server version: 3.23.54
# PHP Version: 4.2.3
# Database : `database-name`
# --------------------------------------------------------
#
# Table structure for table `adminblock`
#
CREATE TABLE adminblock (
title varchar(60) default NULL,
content text
) TYPE=MyISAM;
#
# Dumping data for table `adminblock`
#
INSERT INTO adminblock VALUES ('Administration Menu', 'Admin tools for the Web Technology Group\r\n<br /><span class="onebiggerred">></span>\r\n<a href="admin.php">Administration</a>\r\n<br /><span class="onebiggerred">></span>\r\n<a href="admin.php?op=logout">Logout</a>\r\n');
INSERT INTO adminblock VALUES ('Administration Menu', 'Admin tools for the Web Technology Group\r\n<br /><span class="onebiggerred">></span>\r\n<a href="admin.php">Administration</a>\r\n<br /><span class="onebiggerred">></span>\r\n<a href="admin.php?op=logout">Logout</a>\r\n');
# --------------------------------------------------------
#
# Table structure for table `authors`
#
CREATE TABLE authors (.....again...bla...bla...bla...
the difference is.. myssqldump is giving me "--".. where phpmyadmin is giving me "##" for comments...
could someone tell me how to get mysqldump to output so phpmyadmin can restore the database....
phpmyAdmin Ver ?? I have ask for the vers.. not sure yet
mysql client Ver 3.23.39
php Ver 4.2.3-1
Sorry this is so long.. but I wanted to try to give you all the info that someone might need....
Scott