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
| SitePoint Sponsor |
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
Many Thanks & Best Regards,
HuaMin Chen
Furthermore, is there any example for that we insert one record with one image file (from the local disk), to the DB table?
Many Thanks & Best Regards,
HuaMin Chen
Any advice?
Many Thanks & Best Regards,
HuaMin Chen


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 '?
Many Thanks & Best Regards,
HuaMin Chen


thanks. How about this problem?
I'm to create one table. Why do i need to run 'show create table'?
Many Thanks & Best Regards,
HuaMin Chen


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)
Many Thanks & Best Regards,
HuaMin Chen


are you ready to try the INSERT?
yes
Many Thanks & Best Regards,
HuaMin Chen
Can you provide more details like to use any disk files for the insert, to me?
Many Thanks & Best Regards,
HuaMin Chen
can you help?
Many Thanks & Best Regards,
HuaMin Chen
Hi,
How about the way to insert one record with one image to the table? I mean to directly run this using mysql prompt.
Many Thanks & Best Regards,
HuaMin Chen


17-29% of paid ad clicks are fraudulent. Get protected with Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more.
Many thanks. But could you pls show me how I can save one physical image file from the disk to Mysql DB?
Many Thanks & Best Regards,
HuaMin Chen


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.
17-29% of paid ad clicks are fraudulent. Get protected with Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more.
thanks. Is it true that the only way is to use PHP and no direct way to put that through Mysql command prompt?
Many Thanks & Best Regards,
HuaMin Chen


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.
17-29% of paid ad clicks are fraudulent. Get protected with Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more.
Is there an example? Many many thanks in advance!
Many Thanks & Best Regards,
HuaMin Chen
Bookmarks