Export

Hi,
Is it OK by this? I expect that the export file will be backup.sql
mysqldump --tables -u db_user_name -p db_name >> backup.sql

Furthermore, is there any example for that we insert one record with one image file (from the local disk), to the DB table?

Any advice?

for your first question (“is it OK by this”), you can get your answer by testing what you have to see if it works

for your second question (“insert one record with one image file”), you need to provide more information – start with giving us the results of the SHOW CREATE TABLE statement for the table

Thanks
I’ve tried this and have got
C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqldump -u user_name -p the_password -database
s DBname > backup.sql
mysqldump: unknown option ‘-b’

Next what should be the right syntax of 'SHOW CREATE TABLE statement '?

SHOW CREATE TABLE [I]tablename[/I]

thanks. How about this problem?

I’m to create one table. Why do i need to run ‘show create table’?

so that i can help you with your problem “insert one record with one image file”

many thanks!

mysql> show create table ae_gallery;
±-----------±-----------------------------------------------------------------



-----------------------------------------+
| Table | Create Table

                                     |

±-----------±-----------------------------------------------------------------



-----------------------------------------+
| ae_gallery | CREATE TABLE ae_gallery (
id int(11) NOT NULL AUTO_INCREMENT,
title varchar(64) CHARACTER SET utf8 NOT NULL,
ext varchar(8) CHARACTER SET utf8 NOT NULL,
image_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TI
MESTAMP,
data mediumblob NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
±-----------±-----------------------------------------------------------------



-----------------------------------------+
1 row in set (1.92 sec)

are you ready to try the INSERT?

yes

Can you provide more details like to use any disk files for the insert, to me?

can you help?

Hi,
How about the way to insert one record with one image to the table? I mean to directly run this using mysql prompt.

http://dev.mysql.com/doc/refman/5.1/en/insert.html

Many thanks. But could you pls show me how I can save one physical image file from the disk to Mysql DB?

You cannot do that from the mysql console. You need a programming language to read the image data off disk and insert it into a query.

thanks. Is it true that the only way is to use PHP and no direct way to put that through Mysql command prompt?

The mysql client program has no way to read binary data off disk. The only filesystem function it provides is a command to read SQL queries from a text file.

Is there an example? Many many thanks in advance!