D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] Uploading MySQL



Hi

I have rewritten the emails and put them into two. Here is the first problem I have. I have compiled a sql database on my home computer and now want to load it up to the server. I was told to write a sql query to upload the database. Hence the following. The error message I get follows on from that.

SQL-query?:?
<x-tad-bigger>FILE=rocheafc.sql
NAME=rocheafc
PASS=********
DB=rocheafc

echo "Content-type: text/plain"
echo
echo "Tried to import file: "$FILE

/usr/bin/mysql -u $NAME --password=$PASS $DB < $FILE


</x-tad-bigger>
MySQL said:

<x-tad-bigger>You have an error in your SQL syntax near 'FILE=rocheafc.sql
NAME=rocheafc
PASS=********
DB=rocheafc

echo "Content-ty' at line 1
</x-tad-bigger>

UKLinux advised me this:-
I've looked at your script and it is failing on two parts.

Firstly you need to make sure that your text editor is set to save with
unix style line endings.

Secondly, and most importantly, you had it said for a user called root.
Obviously that wont work. The username is rocheafc!!!!

In phpmyadmin you do it as a query. So in the case presuming that you sql
backup file contains the database structure you "run the query" from the
"location of the textfile"

Since I am using Mac OS X I don't have the tools I would have used under Linux. It shouldn't matter because X is bsd based anyway!

Any ideas. I could enclose a copy of the sql file if someone wouldn't mind looking at that.

Thanks.

Rich
www.littlebigfoot.org.uk
"How beautiful on the mountains are the feet of the messenger bringing good news." Isaiah 52 v 7 (The Message)

Lynx friendly