Re: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

2007-08-08 Thread dpgirago
Problems again with the survey design and functionality. Page 4 asks 
questions about Falcon, and to be honest I don't know anything about 
Falcon, but you've required answers to advance and only offered yes' and 
no' as choices.  Without a Don't know choice as an option, your results 
will be totally skewed. I designed survey questionnaires in my past life 
as a psychologist, and this one is fatally flawed. I'm done. I won't try 
again.

David 

 Thanks for the input!  Hopefully, I've fixed the problem.

 Please retry.  It should have saved your previous answers.

 Thanks much!

 Jay

J.R. Bullington wrote:
   I received the same as David. The 
question was:
 
 What OS do you currently use? Please check all that apply: (page 3, 
question 4 or 5):
 
 I chose Linux 2.6.x and Windows. It kept telling me that I needed to 
answer the question.
 
 I changed the answer to just Linux and it let me thru.
 
 Just to provide a little more info for you.
 
 J.R.
 
 
 
   From: 
[EMAIL PROTECTED]
 Sent: Tuesday, August 07, 2007 9:35 AM
 To: 'Jay Pipes' [EMAIL PROTECTED], mysql@lists.mysql.com
 Subject: RE: 2007 MySQL Community Survey - Got Ten Minutes to Spare? 
 
 Having a moment of altruism, I started doing the survey only to find 
that 
 it wouldn't let me advance to the next page (from either page 1 or page 
2, 
 can't recall). I kept getting an error of an answer is required of 
this 
 question even when I had provided one. No good deed goes unpunished 
 perhaps...
 
 David
 
 So I was gonna take this survey (I don't need or care about the 
book,
 just wanted to help you out) and honestly, it's more like a quiz --
 needless to say I didn't do it. 

 :-| 
 
 -Original Message-
 From: Jay Pipes [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 03, 2007 2:33 PM
 To: mysql@lists.mysql.com
 Subject: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

 2007 MySQL Community Survey - Bribe Included

 I've created a survey on SurveyMonkey that I am hoping to get 
 a bunch of 
 responses for. The survey will help the community team identify how 
 (in)effectively we communicate development and other goals 
 and also what 
 features you, our community users, most want in future versions of 
 MySQL. So, hey, give us ten minutes of your time and help us 
 make MySQL 
 better.

 A Blatant Bribe for Participating

 And for those who need a bribe, we'll be giving away two Apress books 

 (each) to 3 random survey takers. The survey is anonymous, but if you 

 would like to go into the drawing for the books, just include 
 your email 
 address in the very last question...otherwise, just leave it blank.

 Link to the 2007 Community survey:

 http://www.surveymonkey.com/s.aspx?sm=ONCdTFPxjyq55NAUBUJ_2fvQ_3d_3d

 Thanks much!

 Jay Pipes
 Community Relations Manager, North America
 MySQL, Inc.

Inserting null values in mysql with PHP

2007-08-08 Thread Mahmoud Badreddine
Hello
I have a table which contain a few numerical values.
I set the default values to be NULL.
When I insert values using phpMyAdmin, it sets the values to NULL correctly.
But when I insert using a PHP script that I wrote it sets the values
to 0.00or 0.
In my script I do test if the values are empty and in case they are I set
the variable to NULL. But that still doesn't help.
Is that a mysql problem ?
Thank you.

-- 
-Mahmoud Badreddine

http://www.spreadfirefox.com/


Import file into MySQL Database..

2007-08-08 Thread Jason Pruim

Okay, so I have been going crazy trying to figure this out...

All I want to do is load a excel file (Which I can convert to just  
about anything) into a MySQL database... Should be easy right?


Here is the command that I have tried:  LOAD DATA LOCAL INFILE '/ 
volumes/raider/AML.master.txt' INTO TABLE current FIELDS TERMINATED  
BY '\t' ENCLOSED BY '' LINES TERMINATED BY '\n';


and here is the error I am getting: | Warning | 1264 | Out of range  
value adjusted for column 'Record' at row 1 |


What do I need to change to get this to work? Or what other info do  
you need to be able to help me? :)


Thanks!


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]




RE: Import file into MySQL Database..

2007-08-08 Thread Stephen Sunderlin
If you can import your excel doc into MS Access I'd suggest: 
http://www.mysql.com/products/tools/migration-toolkit/

I just started using and love it -  easy intutitive GUI tool for importing
data into nySQL databases.

Good luck.



-Original Message-
From: Jason Pruim [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 08, 2007 1:15 PM
To: mysql@lists.mysql.com
Subject: Import file into MySQL Database..

Okay, so I have been going crazy trying to figure this out...

All I want to do is load a excel file (Which I can convert to just about
anything) into a MySQL database... Should be easy right?

Here is the command that I have tried:  LOAD DATA LOCAL INFILE '/
volumes/raider/AML.master.txt' INTO TABLE current FIELDS TERMINATED BY '\t'
ENCLOSED BY '' LINES TERMINATED BY '\n';

and here is the error I am getting: | Warning | 1264 | Out of range value
adjusted for column 'Record' at row 1 |

What do I need to change to get this to work? Or what other info do you need
to be able to help me? :)

Thanks!


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Inserting null values in mysql with PHP

2007-08-08 Thread Michael Dykman
That is MySQL, not PHP doing that to you.  You need to set your
SQL_MODE to strict to get that kind of behavior..  there are other
implications to this mode so you should review:

http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html

 - michael

On 8/8/07, Mahmoud Badreddine [EMAIL PROTECTED] wrote:
 Hello
 I have a table which contain a few numerical values.
 I set the default values to be NULL.
 When I insert values using phpMyAdmin, it sets the values to NULL correctly.
 But when I insert using a PHP script that I wrote it sets the values
 to 0.00or 0.
 In my script I do test if the values are empty and in case they are I set
 the variable to NULL. But that still doesn't help.
 Is that a mysql problem ?
 Thank you.

 --
 -Mahmoud Badreddine

 http://www.spreadfirefox.com/



-- 
 - michael dykman
 - [EMAIL PROTECTED]

 - All models are wrong.  Some models are useful.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Import file into MySQL Database..

2007-08-08 Thread Jason Pruim
A... the one thing I can't do... I don't have Access to well...  
Access... :)


Did some more testing, made a new table and matched the field names,  
now it will load it without any errors, it's just only importing the  
first row... Not the rest of the 934 records...



On Aug 8, 2007, at 1:20 PM, Stephen Sunderlin wrote:


If you can import your excel doc into MS Access I'd suggest:
http://www.mysql.com/products/tools/migration-toolkit/

I just started using and love it -  easy intutitive GUI tool for  
importing

data into nySQL databases.

Good luck.



-Original Message-
From: Jason Pruim [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 08, 2007 1:15 PM
To: mysql@lists.mysql.com
Subject: Import file into MySQL Database..

Okay, so I have been going crazy trying to figure this out...

All I want to do is load a excel file (Which I can convert to just  
about

anything) into a MySQL database... Should be easy right?

Here is the command that I have tried:  LOAD DATA LOCAL INFILE '/
volumes/raider/AML.master.txt' INTO TABLE current FIELDS TERMINATED  
BY '\t'

ENCLOSED BY '' LINES TERMINATED BY '\n';

and here is the error I am getting: | Warning | 1264 | Out of range  
value

adjusted for column 'Record' at row 1 |

What do I need to change to get this to work? Or what other info do  
you need

to be able to help me? :)

Thanks!


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql? 
[EMAIL PROTECTED]





--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Suse Linux (SLES10), Portuguese characters and dead keys in MySQL monitor in SSH sessions with Unicode (UTF-8)

2007-08-08 Thread Ricardo Dias Marques
Hi all,

Here I am, following up to my own post - available below and at
http://lists.mysql.com/mysql/208343 - with a solution (basically, a
workaround).

To summarize: I couldn't enter Portuguese accented characters in
MySQL monitor (MySQL command line / console client), when I'm in a
SSH (Secure Shell) Session, in a SUSE Linux Enterprise Server 10,
configured to use Unicode (UTF-8 encoding).

The Portuguese accented characters appeared well, in the same SSH
session, for other shell (bash) commands and in Vim editing sessions
(using the same Portuguese keyboard with accent keys that are dead
keys).

To make a long story short, the problem does NOT seem to be related
with the SSH session, but seems to be related with the shell *user*
that I use to login:

1 - If I log in to the shell of the Linux server with a regular user,
either through a SSH session or directly in the local console (the one
physically attached to the server) and I do a su to change to the
root user, then the following happens: when I enter the mysql
console (by entering the mysql command), the accented characters do
NOT appear (typing ã - lowercase a with tilde accent - appears as a #
- hash sign).

2 - If I log in to the shell of the Linux server directly with the
root user, when I enter the mysql console (by entering the mysql
command) all the accented characters appear correctly (this also
happens either in a SSH session or by logging in directly in the local
console).

Like I said in my previous post, this server has the following MySQL version:
5.0.41-community MySQL Community Edition (GPL).

I forgot to mention that I'm using bash shell - GNU bash, version
3.1.17(1)-release (i586-suse-linux) and that my readline version is
5.1-24.4

The bug is also happening in another server that's using version
5.0.45-community MySQL Community Edition (GPL).

Did anyone else have this problem? If so, how did you solve it? Did
you change everything from UTF-8 back to ISO-8859-1? *Or* do you enter
directly as root, as I'm doing now (to work around this issue)? *Or*
do you simply do NOT type accented characters directly in the MySQL
Monitor (that is, the command line mysql client)?


Thanks in advance for any info that you may give me!  :)

Best wishes,
Ricardo Dias Marques
newsgroup DOT posts AT gmail DOT com


On 7/31/07, Ricardo Dias Marques [EMAIL PROTECTED] wrote:

 Hi all,

 First of all, sorry for the lengthy subject, but it serves to describe
 my problem:

 I'm having problems entering Portuguese accented characters (with a
 Portuguese keyboard) in MySQL monitor (MySQL command line / console
 client), when I'm in a SSH (Secure Shell) Session, in a Linux Server
 configured to use Unicode (UTF-8 encoding).

 I'm using dead keys - http://en.wikipedia.org/wiki/Dead_key - to
 enter the accented characters. That is, if I press the ã (tilde sign)
 key on my keyboard and then press a (lowercase a) then I get ã
 (lowercase a with tilde accent).

 This is a sample output from a SSH session, from a computer running
 putty version 0.60 (in Windows XP Professional with Service Pack 2)
 to my Linux Server (Suse Linux Enterprise Server 10 - aka SLES 10),
 located in the same LAN:

 # whoami
 root

 # echo Áá Ãã Çç
 Áá Ãã Çç

 [ Great... Portuguese characters seem to be working well so far, both
 in the input and in output. Now, I'll enter the mysql console: ]

 # mysql

 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 3
 Server version: 5.0.41-community MySQL Community Edition (GPL)

 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 [ OK... Let me try to enter one lowercase ã - a with tilde accent ]

 mysql #


 Now, you may be wondering why I'm getting that hash sign instead of
 ã (lower case a with tilde) ... I'm wondering the same thing!  ;-)

 The funny thing is that if I try to type other accented characters, in
 this mysql console, it does NOT display ANY character!


 Here's the output of \s  (status):

 mysql \s
 --
 mysql  Ver 14.12 Distrib 5.0.41, for pc-linux-gnu (i686) using readline 5.0

 Connection id:  5
 Current database:
 Current user:   [EMAIL PROTECTED]
 SSL:Not in use
 Current pager:  less
 Using outfile:  ''
 Using delimiter:;
 Server version: 5.0.41-community MySQL Community Edition (GPL)
 Protocol version:   10
 Connection: Localhost via UNIX socket
 Server characterset:latin1
 Db characterset:latin1
 Client characterset:utf8
 Conn.  characterset:utf8
 UNIX socket:/var/lib/mysql/mysql.sock
 Uptime: 1 hour 40 min 38 sec


 And here's the output of the character set variables:

 mysql show variables like 'char%';
 +--++
 | Variable_name| Value  |
 +--++
 | character_set_client | utf8

Re: Import file into MySQL Database..

2007-08-08 Thread Mark Kelly
Hi.

On Wednesday 08 August 2007 18:39, Jason Pruim wrote:
 Did some more testing, made a new table and matched the field names,
 now it will load it without any errors, it's just only importing the
 first row... Not the rest of the 934 records...

You are using ENCLOSED BY '' in your SQL, which I have had cause hassle 
with excel generated csv files. Basically, excel will only wrap field 
values in double quotes if the value contains the field delimiter. This 
caught me out, although I seem to remember I did get an error. Try 
removing the ENCLOSED BY anyway, it's optional.

Another thing to watch for is column headers in your input file that may be 
triggering column constraints. You can get past this by using the IGNORE n 
LINES syntax in your command.

I usually specify the table column names too - I have happily loaded up csv 
files from excel with something like the following:

LOAD DATA LOCAL 
INFILE 'file.csv' 
INTO TABLE MyTable
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 
IGNORE 1 LINES
(column1,column2,column_etc);

Hope this helps.

Mark


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Import file into MySQL Database..

2007-08-08 Thread Gary Josack

Jason Pruim wrote:

Okay, so I have been going crazy trying to figure this out...

All I want to do is load a excel file (Which I can convert to just 
about anything) into a MySQL database... Should be easy right?


Here is the command that I have tried:  LOAD DATA LOCAL INFILE 
'/volumes/raider/AML.master.txt' INTO TABLE current FIELDS TERMINATED 
BY '\t' ENCLOSED BY '' LINES TERMINATED BY '\n';


and here is the error I am getting: | Warning | 1264 | Out of range 
value adjusted for column 'Record' at row 1 |


What do I need to change to get this to work? Or what other info do 
you need to be able to help me? :)


Thanks!


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]



What is the first line in your text file? Also, can you provide a 
DESCRIBE of the table you're trying to insert into?


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Import file into MySQL Database..

2007-08-08 Thread Jason Pruim

First line of my .csv file is:

First,Last,Add1,Add2,City,State,Zip,Date,Xcode,Reason

DESCRIBE is:

mysql describe test;
++-+--+-+-+---+
| Field  | Type| Null | Key | Default | Extra |
++-+--+-+-+---+
| First  | varchar(20) | YES  | | NULL|   |
| Last   | varchar(20) | YES  | | NULL|   |
| Add1   | varchar(50) | YES  | | NULL|   |
| Add2   | varchar(50) | YES  | | NULL|   |
| City   | varchar(20) | YES  | | NULL|   |
| State  | varchar(10) | YES  | | NULL|   |
| Zip| varchar(20) | YES  | | NULL|   |
| XCode  | varchar(20) | YES  | | NULL|   |
| Reason | varchar(50) | YES  | | NULL|   |
| Date   | varchar(20) | YES  | | NULL|   |
++-+--+-+-+---+
10 rows in set (0.09 sec)


I've also tried adding the filed names at the end of my load data  
command but that didn't help...


As it sits right now this is the command I'm attempting to use:
mysql LOAD DATA LOCAL  INFILE '/volumes/raider/aml.master. 
8.6.07.csv'  INTO TABLE test FIELDS TERMINATED BY ','  LINES  
TERMINATED BY '\n'  IGNORE 1 LINES;


Which displays this:

Query OK, 0 rows affected (0.01 sec)
Records: 0  Deleted: 0  Skipped: 0  Warnings: 0

if I remove the IGNORE 1 LINES; from the end then I get this added  
into the table:


A. DREW | Last | Add1 | Add2 | City | State | Zip  | Date  | Xcode  |  
Reason


Which is a combination of the first address and the column names.



On Aug 8, 2007, at 3:34 PM, Gary Josack wrote:


Jason Pruim wrote:

Okay, so I have been going crazy trying to figure this out...

All I want to do is load a excel file (Which I can convert to just  
about anything) into a MySQL database... Should be easy right?


Here is the command that I have tried:  LOAD DATA LOCAL INFILE '/ 
volumes/raider/AML.master.txt' INTO TABLE current FIELDS  
TERMINATED BY '\t' ENCLOSED BY '' LINES TERMINATED BY '\n';


and here is the error I am getting: | Warning | 1264 | Out of  
range value adjusted for column 'Record' at row 1 |


What do I need to change to get this to work? Or what other info  
do you need to be able to help me? :)


Thanks!


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]



What is the first line in your text file? Also, can you provide a  
DESCRIBE of the table you're trying to insert into?




--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

2007-08-08 Thread Jay Pipes

[EMAIL PROTECTED] wrote:
Problems again with the survey design and functionality. Page 4 asks 
questions about Falcon, and to be honest I don't know anything about 
Falcon, but you've required answers to advance and only offered yes' and 
no' as choices.  Without a Don't know choice as an option, your results 
will be totally skewed. I designed survey questionnaires in my past life 
as a psychologist, and this one is fatally flawed. I'm done. I won't try 
again.


Well, since I'm not a psychologist, I did the best I could, David.  I'll 
remember your input for the next one and hopefully do a better job.


Cheers,

Jay

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Import file into MySQL Database..

2007-08-08 Thread Christian High
I believe that excel files generally terminate lines with '\r\n' and
if you use terminated by '\n' it will cause this behavior. so try it
with lines terminated by '\r\n' or get TextPad or a similar editor
that can save the file as unix platform that uses the same line
terminators that MySQL expects by default and leave out the optional
terminated by

cj

On 8/8/07, Jason Pruim [EMAIL PROTECTED] wrote:
 Okay, so I have been going crazy trying to figure this out...

 All I want to do is load a excel file (Which I can convert to just
 about anything) into a MySQL database... Should be easy right?

 Here is the command that I have tried:  LOAD DATA LOCAL INFILE '/
 volumes/raider/AML.master.txt' INTO TABLE current FIELDS TERMINATED
 BY '\t' ENCLOSED BY '' LINES TERMINATED BY '\n';

 and here is the error I am getting: | Warning | 1264 | Out of range
 value adjusted for column 'Record' at row 1 |

 What do I need to change to get this to work? Or what other info do
 you need to be able to help me? :)

 Thanks!


 --

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 3251 132nd ave
 Holland, MI, 49424
 www.raoset.com
 [EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Import file into MySQL Database..

2007-08-08 Thread Gary Josack

Jason Pruim wrote:

First line of my .csv file is:

First,Last,Add1,Add2,City,State,Zip,Date,Xcode,Reason

DESCRIBE is:

mysql describe test;
++-+--+-+-+---+
| Field  | Type| Null | Key | Default | Extra |
++-+--+-+-+---+
| First  | varchar(20) | YES  | | NULL|   |
| Last   | varchar(20) | YES  | | NULL|   |
| Add1   | varchar(50) | YES  | | NULL|   |
| Add2   | varchar(50) | YES  | | NULL|   |
| City   | varchar(20) | YES  | | NULL|   |
| State  | varchar(10) | YES  | | NULL|   |
| Zip| varchar(20) | YES  | | NULL|   |
| XCode  | varchar(20) | YES  | | NULL|   |
| Reason | varchar(50) | YES  | | NULL|   |
| Date   | varchar(20) | YES  | | NULL|   |
++-+--+-+-+---+
10 rows in set (0.09 sec)


I've also tried adding the filed names at the end of my load data 
command but that didn't help...


As it sits right now this is the command I'm attempting to use:
mysql LOAD DATA LOCAL  INFILE 
'/volumes/raider/aml.master.8.6.07.csv'  INTO TABLE test FIELDS 
TERMINATED BY ','  LINES TERMINATED BY '\n'  IGNORE 1 LINES;


Which displays this:

Query OK, 0 rows affected (0.01 sec)
Records: 0  Deleted: 0  Skipped: 0  Warnings: 0

if I remove the IGNORE 1 LINES; from the end then I get this added 
into the table:


A. DREW | Last | Add1 | Add2 | City | State | Zip  | Date  | Xcode  | 
Reason


Which is a combination of the first address and the column names.



On Aug 8, 2007, at 3:34 PM, Gary Josack wrote:


Jason Pruim wrote:

Okay, so I have been going crazy trying to figure this out...

All I want to do is load a excel file (Which I can convert to just 
about anything) into a MySQL database... Should be easy right?


Here is the command that I have tried:  LOAD DATA LOCAL INFILE 
'/volumes/raider/AML.master.txt' INTO TABLE current FIELDS 
TERMINATED BY '\t' ENCLOSED BY '' LINES TERMINATED BY '\n';


and here is the error I am getting: | Warning | 1264 | Out of range 
value adjusted for column 'Record' at row 1 |


What do I need to change to get this to work? Or what other info do 
you need to be able to help me? :)


Thanks!


--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]



What is the first line in your text file? Also, can you provide a 
DESCRIBE of the table you're trying to insert into?




--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]



Try:

|load data local infile '|/volumes/raider/aml.master.8.6.07.|csv' 
into table test fields terminated by ',' enclosed by '' lines terminated by '\n' 
|ignore 1 lines

|(First, Last, Add1, Add2, City, State, Zip, XCode, Reason, Date);

If that doesn't work could you please provide more output from the csv file in 
question?
|


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Binary Log Incremental / Full Backups

2007-08-08 Thread George Cooke
I am new to MySQL administration, and must devise a backup plan, I have read
the manual but still want to know if I am understanding and applying the
principals correctly, please let me know if you have a better way, or if I
am wrong somewhere, my main question is regardng the locking of the database
while dumping, is it strictly neccessary (see [Confusion] block)?

I am trying to devise a backup plan for MySQL ISAM Databases, I have chosen
to use binary logs to enable incremental an incremental backup plan.
I need to eliminate possibility of data being lost, and assure integrity of
data, I will mainly be dealing with the former in this message.

The Backup Plan:

Preparation:
1. Enable binary logging on server
2. Prepare backup location (I was thinking SCP over the internet to a backup
host, any faster/better soloutions?)
3. Write full and incremental script(s)
4. Set up cron jobs to run the incremetal and full backup scripts daily, and
weekly respectivley
5. Run the Full backup script once

[Full backup script actions]
1. Lock the database so it cannot change,
2. Backup the entire database via a dump, compress, transfer
3. Reset the logs (RESET MASTER, causing binlog index to be reset,
ALL logs deleted and new log file created, thats ok, we have a full backup)
4. Unlock the database
[/Full backup script]

[Incremental backup script actions]
  1. Flush logs
  2. backup all logs except the last one via compress and transfer
  3. purge all logs except the last one
[/Incremental]

[Schedule]
Day 1: execute incremtal
..
Day 7: execute incremtal
   execute full, binary log index is reset
[/Schedule]


Please tell me if this is the best  correct way to do it, and if any of my
following statements are incorrect/I have missed something:

[Confusion]
You need to lock the database when doing a full backup to maintain integrity
of the logs, after the backup time becuase without locking:
1. If you flush logs, then dump, and a change occurs which is reflected in
the dump, restoring the log to this backup will duplicate the change.
2. If you reset logs then dump, you have lost the information between your
last backup and the dump if the dump fails
3. If you dump then reset, and data has changed in between the dump of a
record and the new log, that change will be lost forever.
4. If you dump then flush (excuse the pun), restoring the log from before
the dump to the dump could duplicate data
[/Confusion]

Whereas:
If you lock the database, then dump, then reset logs and unlock, you have an
exact mirror of the data, and a log file which contains changes after the
dump was made

Thanks.


Re: Inserting null values in mysql with PHP

2007-08-08 Thread Brent Baisley
One thing to check is to make sure you are not quoting your NULL  
value for your insert statement. MySQL will try to convert that to a  
numeric value, which may end up as 0.


On Aug 8, 2007, at 12:55 PM, Mahmoud Badreddine wrote:


Hello
I have a table which contain a few numerical values.
I set the default values to be NULL.
When I insert values using phpMyAdmin, it sets the values to NULL  
correctly.

But when I insert using a PHP script that I wrote it sets the values
to 0.00or 0.
In my script I do test if the values are empty and in case they are  
I set

the variable to NULL. But that still doesn't help.
Is that a mysql problem ?
Thank you.

--
-Mahmoud Badreddine

http://www.spreadfirefox.com/



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: auto increment format

2007-08-08 Thread Brent Baisley
If you are going to implement real security, it shouldn't matter if  
someone nows the unique id of a record. You should be checking if  
they have the right to see that record.


But regardless, there is an easy way to set random ids as your  
unique identifier. Setup 2 fields, one being the random number of  
string that you generate, the other being an auto_increment field.  
You primary key will be the combination of these field (random 
+autoincrement). The auto_increment field will almost always be 1  
until there is a conflict with the random ids, in which case it will  
increment. The downside is that all your queries (joins too) will  
need to reference 2 fields instead of 1.


On Aug 7, 2007, at 8:05 AM, shivendra wrote:



Hi, I'm looking for some basic help. I am developing a MySQL  
database and
want to auto increment a field, but I don't want it to just count  
1,2,3,
etc. I want the field to be a combination of letters and numbers,  
at least 8

digits long, completely random for security porposes, but do this
automatically, everytime a record is added. For example, ord5001,  
ord5002,

ord5003, etc. Does anyone know how to do this in MySQL?
--
View this message in context: http://www.nabble.com/auto-increment- 
format-tf4229677.html#a12032917

Sent from the MySQL - General mailing list archive at Nabble.com.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql? 
[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Inserting null values in mysql with PHP

2007-08-08 Thread Christian High
On 8/8/07, Brent Baisley [EMAIL PROTECTED] wrote:
 One thing to check is to make sure you are not quoting your NULL
 value for your insert statement. MySQL will try to convert that to a
 numeric value, which may end up as 0.

 On Aug 8, 2007, at 12:55 PM, Mahmoud Badreddine wrote:

  Hello
  I have a table which contain a few numerical values.
  I set the default values to be NULL.
  When I insert values using phpMyAdmin, it sets the values to NULL
  correctly.
  But when I insert using a PHP script that I wrote it sets the values
  to 0.00or 0.
  In my script I do test if the values are empty and in case they are
  I set
  the variable to NULL. But that still doesn't help.
  Is that a mysql problem ?
  Thank you.
 
  --
  -Mahmoud Badreddine
 
  http://www.spreadfirefox.com/


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


As long as you are testing to see if they should be null, and the
default is set to null, you could exclude the column all together from
the insert statement and you should see they are then recorded in the
table as null.

cj

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]