Re: start up problem

2002-04-29 Thread Steven Hajducko

Hey Cindy,

Usually you can get a better idea of the real problem by looking in the
hostname.err (where hostname is the hostname of your machine) file in
whatever directory you are storing your logs in.  Is there any info in
that file that you can post?

You can check to make sure another mysql.sock doesn't exist in /tmp
already ( Maybe one got created by the mysql_att user, and the mysql
user can't overwrite it. ).  That or you may want to shut down the
server, clear out any mysql.sock files in /tmp and restart the mysql
server.

--
sh


On Mon, 2002-04-29 at 11:28, Cindy wrote:
> 
> Cindy writes:
>  >
>  >OK, it seems like every time I install mysql, I run smack dab into
>  >some type of access problem -- if it isn't a password hangup, it's a
>  >mysql.sock problem or (at the moment) a refusal to allow me to create
>  >databases.  I've puzzled through most of it for now, but this one
>  >has me stumped.
> 
> A bit of an update.  I've come around full circle, so I'm ready
> to scream.
> 
> I finally noticed that the usernames didn't match -- the safe_mysqld
> script assumes username mysql, but I use mysql_att, etc for different
> machines.  So.  I fixed that, and reran safe_mysqld.  Now I get
> can't find host.frm.  Aha, I say.  I know what that is.  So I run
> the scripts/mysql_install_db.  That runs.  OK, cool, now I set the
> root password.
> 
> [11:23am] root@attalus> ./bin/mysqladmin -u root -p password '***'
> Enter password: ***
> ./bin/mysqladmin: connect to server at 'localhost' failed
> error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
> Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
> 
> .
> 
> OK, so the sticky bit is set on the /tmp dir, so I'm guessing this is
> still a matter of an access problem.  But I thought the script
> took care of that.
> 
> Getting dizzy from these circles,
> --Cindy
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: start up problem

2002-04-29 Thread Steven Hajducko

The var dir is usually where the databases and logs go.  At least, from
the sources I've compiled, thats where it always gets stored.

On Mon, 2002-04-29 at 10:03, Cindy wrote:
> 
> OK, it seems like every time I install mysql, I run smack dab into
> some type of access problem -- if it isn't a password hangup, it's a
> mysql.sock problem or (at the moment) a refusal to allow me to create
> databases.  I've puzzled through most of it for now, but this one
> has me stumped.
> 
> It's giving me perror 13, which is a write permission problem.  But
> I've checked and double checked, and the data directory is indeed
> writable by my mysql account:
> 
> mysql> create database Text; use Text;
> ERROR 1006: Can't create database 'Text'. (errno: 13)
> mysql>
> Suspended
> mysql_att> mkdir /usr/local/mysql/data/Text
> mysql_att> ls
> Text attalus.**.err  mysql
> 
> I've linked the /usr/local/mysql/data file to another filesystem
> with a good deal more space, but that shouldn't be a problem (that's
> how I set it up on another one of our machines).
> 
> Thoughts?
> 
> And while I'm at it, can someone also tell me what the heck the
> /usr/local/mysql/var directory is all about?  Inevitably, the reason I
> reinstall mysql all the time (binary dist) is because when I get back
> to a machine and want to do something administrative about once a
> quarter, it can't find things in the var directory, but I don't HAVE a
> var directory.  (I think the source code dist creates that, but not
> the binary code dist.)
> 
> 
> Thanks,
> --Cindy
> -- 
> [EMAIL PROTECTED]
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How to Install as non-root user in Unix system?

2002-04-23 Thread Steven Hajducko

I think the general procedure is the same, just a couple things you have
to consider.

1. The mysql daemon will have to run under your user name.
2. You might not be able to use port 3306, you'll have to check with the
sys admin for this.
3. You'll have to install it into your home directory ( check
./configure --help for more info on this )

Most source packages that you compile don't require you to be root to
'make' them, just when you do 'make install'.

--
sh


On Tue, 2002-04-23 at 14:02, Paul E Johnson wrote:
> I have an account on our Dec Unix system and I can't find any directions 
> on how to make MySQL work without root privileges. Can it be done?
> 
> pj
> -- 
> Paul E. Johnson   email: [EMAIL PROTECTED]
> Dept. of Political Sciencehttp://lark.cc.ukans.edu/~pauljohn
> University of Kansas  Office: (785) 864-9086
> Lawrence, Kansas 66045FAX: (785) 864-5700
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: MyODBC

2002-04-17 Thread Steven Hajducko

Sounds like a user permission problem.

Make sure you're allowed to connect from that ip. ( You can check in the
'user' table in the 'mysql' db. )

--
sh

On Wed, 2002-04-17 at 09:34, Jim Bahr wrote:
> Hi Gang,
> 
> Im trying to set my remote xp pc to connect to my server databases using
> MS Access. I have loaded and configured Myodbc21.50.39 (win95) and my
> DNS but get the following error message when I try to connect in Access.
> [TXC][MyODBC] Host'hxxx-xxx-xxx.ip, Alltel.net is not allowed to connect
> to this MySQL server (#1130).
> 
>  
> 
> The x above = my dsl ip address.
> 
>  
> 
> Any idea what I need to do next? Am I getting close?
> 
> Jim
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: update question number in mysql

2002-04-12 Thread Steven Hajducko

On Fri, 2002-04-12 at 13:52, Christopher Thompson wrote:
> You shouldn't be storing the questio number at all.  You have denormalised 
> your database and this is why you are experiencing this problem.

Maybe I don't understand bin's problem, but storing the question #
wouldn't seem to be de-normalizing.  It would only matter on how he
plans on storing it.

It would seem to matter on a few things -

1) Is he planning on storing more than 1 exam?
2) Can an exam really have the same question #, twice?
If yes, then -
Are the questions split upon sections of the exam?
Are the questions the same, but have subsections? ( 1a, 1b ? )

>From the looks of it, he doesn't seem to want to store more than 1 exam
anyways.  If he did, he could use a 2 field primary key of exam name and
question number.  There just isn't enough information on what he wants
to do.

> 
> Instead, store a unique identifier with each one (an 'id' field, 
> autonumbering) and then, when you pull back all the questions, order it by 
> this ID field.  Your questions won't have numbers assigned to them but you 
> can do that in whatever app uses the questions.

Why not use the question number?  It's unique per exam. (Or should be?).

I can see the case of doing this would help in his problem of the first
and second query, but what if someone enters questions out of order?  If
he deletes a question, then tries to re-insert it, it would end up being
the last question in the exam.

You might want to look into using a transactional table bin.  Then, you
could BEGIN the change, then after your two queries are both completed,
commit the change.  Therefore, if your computer crashed in the middle of
the query, the table would revert to the old form.

> Of course, the truth is that you _can_ do what you want just using SQL.  But 
> trust me, you don't want to.  It would be at least O(n^2), I think, and would 
> be a pain to write.
> 
> On Friday 12 April 2002 2:38 pm, bin cai wrote:
> > Hello, verybody,
> > I am afraid to send my question again.
> >
> > i created a table in mysql database system to store
> > exam questions which has the  following column fields:
> > questionnumber(integer),questionbody(String), answers
> > (String) and etc.
> > My problem is if i delete one row(question record) how
> > can iupdate the questionnumber in the easiest way
> > which
> > means mysql can do for me. Is it possible? or i have
> > to write a method to update questionnumber.
> > if In second  case i got another worry. for example,
> > i wrote two querys,one is to delete this question
> > record another query is to update the
> > questionnumber,that is , all records whose
> > questionnumbers are greater than the questionnumber of
> > the deleted question should deducted by 1. if at the
> > time After the first  query is executed successfully
> > and the second query is being executed, the computer
> > is crashed. the second query will be rolled back. so
> > the question is deleted but the questionnumber is not
> > updated. this will result in a mess.
> > If anybody can give me some hint i will appreicate
> > very much
> > Have a good weekend
> > bin
> >
> >
> > __
> > Music, Movies, Sports, Games! http://entertainment.yahoo.ca
> >
> > -
> > Before posting, please check:
> >http://www.mysql.com/manual.php   (the manual)
> >http://lists.mysql.com/   (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> > <[EMAIL PROTECTED]> Trouble
> > unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Design decision on generating data

2002-04-12 Thread Steven Hajducko

Usually I build my queries dynamically.

I store all the values into a hash ( this is in perl mind you.. )

Then do something like this..

my (@fields, @vals);
my ($field_str, $val_str);
foreach $field_name (keys %hash)
{
if ($hash{$field_name})
{
push @fields, $field_name;
push @vals, $hash{$field_name};
}
}

$field_str = join(",",@fields);
$val_str = join("','",@vals);
$val_str = "'" . $val_str . "'";

$dbh->do("INSERT into TABLE ( $field_str ) VALUES ( $val_str )");

That's a rather simple ver of it.. you'd probably want to insert some
type of data integrity checking in there ( or before you store the
values in the hash. ) and it'd be wise to have some other error checking
too, but it avoids having to deal with NULL vals.

Hope it helps.
--
sh





On Fri, 2002-04-12 at 19:52, Carl Schmidt wrote:
> Thank you for the information.  Let me please clarify that i am using a
> web form.  I tried the one solution of converting those values that are
> not set to null, but mysql complained:
> SQL: INSERT INTO
> 
>Development_Event_Show(showID,venueID,description,ageCutoff,ageDelimiter,price1,price2)
>   VALUES('201423cb79b72b5e11','41663c7c59b77da26','',21,,21,)
>   SQL Error: You have an error in your SQL syntax near '21,)' at line 1
> 
> Notice the pair of double commas and the one comma at the end?  Thats the
> result of setting those values to null.  I thought maybe dynmically
> building the query would be best because that way:
> 1.)those values that are to be set as null, simply could be left out of
> the insert statement.
> 2.)If each timeI returned a row where values were = -1, then i would have
> to add extra logic in ther presentation layer to have those values not be
> displayed.
> 
> Any thoughts?
> 
> Carl
> 
> 
> On Fri, 12 Apr 2002, Christopher Thompson wrote:
> 
> > On Friday 12 April 2002 8:10 pm, Carl Schmidt wrote:
> > > I have a form where a user enters some numbers into text boxes.  Some of
> > > the text boxes can be left blank.  The business logic receives all
> > > variables to all text boxes.  Should I :
> >
> > I'm assuming that you are using an executable file and NOT a web form.  Any
> > data you get from a web form, you must treat as suspect and perform business
> > logic checks in another tier.
> >
> > > 1.) Validate on the page for the presence of a value, and if not, set the
> > > corresponding value to -1 (it will never be this value).  Therefore the
> > > business logic blindly inserts everything.
> >
> > This is reasonable.  Alternatively, set the corresponding value to NULL.
> >
> > > 2.)  Do not have the variables that correspond to blank text boxes be
> > > set to -1.  Have the business logic build a query based on which variables
> > > are or
> > > are not containing a value.  In this case some fields for that row may be
> > > null.
> >
> > I'd avoid this if you can.  Too much dynamicness and it will be hard to test.
> >
> > sql,query.
> >
> > -
> > Before posting, please check:
> >http://www.mysql.com/manual.php   (the manual)
> >http://lists.mysql.com/   (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: load data infile file location???

2002-04-12 Thread Steven Hajducko

Hey BJ,

Can the mysql user actually get into that directory
('/home/user/directory')?

If the mysql user can't read that directory, then it doesn't matter than
it owns that file.  You might want to check, do an 'su - mysql' (
replace mysql with whatever user is running the mysql daemon ), then try
an do an 'ls -l' on both files.

Hope this helps.

--
sh

On Fri, 2002-04-12 at 15:11, Jim Dickenson wrote:
> Did you try load data local? That way, as I understand things, the server is
> not reading the data the client is.
> 
> 
> 
> On 4/12/2002 1:26 PM, "BJ Phillips" <[EMAIL PROTECTED]> wrote:
> 
> > I can load files from '/home/mysql' but when trying to do it from any other
> > user ('/home/user/directory'), I get an error 13 about cannot get stat on
> > file such and such.  The files are located on the server and are owned by
> > the user, both mysql user and the system user.
> > I specify the full path to the files, but still no good.  Like I said, the
> > only difference is the location of the files/home/mysql versus
> > /home/user.
> > What is the deal?
> > 
> > Thanks for you time,
> > 
> > -=BJ=-
> > 
> > 
> > -
> > Before posting, please check:
> >  http://www.mysql.com/manual.php   (the manual)
> >  http://lists.mysql.com/   (the list archive)
> > 
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> -- 
> Jim Dickenson
> mailto:[EMAIL PROTECTED]
> 
> Computers for Marketing Corporation
> http://www.cfmc.com/
> 
> eFax: 1-419-791-8924
> 
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Access Denied

2002-04-11 Thread Steven Hajducko

Did you run the mysql_install_db?

http://www.mysql.com/doc/P/o/Post-installation.html

--
sh

On Thu, 2002-04-11 at 13:53, Jane Tsai wrote:
> Hello, All:
> 
> Once I complete the installation, I try to set up password for root user:
> 
> /usr/bin/mysqladmin -u root -p password 'mypassword'
> 
> It did prompt me for new password, I reentered.  But I got error back:
> Connect to server at 'localhost' failed.
> Error: Access denied for user root@localhost (using password: yes).
> 
> How can I fix this problem?   Thanks in advance for help.
> 
> 
> Jane Tsai
> [EMAIL PROTECTED]
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Converting VARCHAR 255 column to TEXT 64

2002-04-11 Thread Steven Hajducko

It'll expand the limit.

You'll lose the data if you convert from a larger form back to a smaller
one. ( Text to Varchar.. if the text is longer than 255. )

--
sh

On Thu, 2002-04-11 at 12:09, Alex Pilson wrote:
> Does converting one type of column to a bigger type such as listed in 
> my subject lose the information that is contained in that row/column 
> or does it just expand the limit?
> -- 
> <->
>  Alex Pilson
>  FlagShip Interactive, Inc.
>  [EMAIL PROTECTED]
>  404.728.4417
>  404.642.8225 CELL
> 
> // Web Design
> // Lasso Application Development
> // Filemaker Pro / SQL Development
> // Sonic Solutions Creator Authoring
> // Apple DVD Studio Pro Authoring
> // Macromedia Director/Flash Authoring
> <->
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: change local hostname

2002-04-10 Thread Steven Hajducko

Ir.  You got rid of localhost? :) D'oh!

What kind of system is this running on?

If it's a Unix type, what do you have in /etc/hosts?

--
sh

On Wed, 2002-04-10 at 19:19, Jule Slootbeek wrote:
> Hey,
> i just installed MySQL and i can't change anything since it's configured to 
> search for localhost, but my localhost name is something else, how do i 
> change this?
> I know it was stupid of me to change the hostname in the first place, but i 
> didn;t know what i was doing, being a newbie and all.
> any thoughts?
> 
> thanks
> Jule
> 
> ps. if there is a way that i could change my hostname back to locahost, could 
> someone tell me also?
> -- 
> Jule Slootbeek
> [EMAIL PROTECTED]
> http://blindtheory.cjb.net
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Help. I have truly blundered.

2002-04-04 Thread Steven Hajducko

Ok.

Easy enough to fix.

As root..

Do a "kill -9 `ps -ef | grep mysqld | grep -v grep`" ( those are
backticks, not single quotes. )

Or you can do, more manually..

"ps -ef | grep mysqld | grep -v grep"

Then do a "kill -9 PID" where PID is the process ID of the line
returned.

Then try and start the mysqld via init.d.

--
sh

On Thu, 2002-04-04 at 15:11, john wrote:
> Steven,
> 
>The contents are as follows:
> 
> 020404 17:00:21  Aborting
> 
> mysqld ended on  Thu Apr 4 17:00:21 CST 2002
> mysqld started on  Thu Apr 4 17:00:28 CST 2002
> 020404 17:00:28  Can't start server: Bind on TCP/IP port: Address already in
> use
> 020404 17:00:28  Do you already have another mysqld server running on port:
> 3306 ?
> 020404 17:00:28  Aborting
> 
> mysqld ended on  Thu Apr 4 17:00:28 CST 2002
> mysqld ended on  Thu Apr 4 17:21:00 CST 2002
> 
> John
> 
> >From: Steven Hajducko [mailto:[EMAIL PROTECTED]]
> >What do the contents of the ns1.acculock.com.err file look like?
> 
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Help. I have truly blundered.

2002-04-04 Thread Steven Hajducko

What do the contents of the ns1.acculock.com.err file look like?

--
sh

On Thu, 2002-04-04 at 14:45, john wrote:
> Yeah, I wish it were that easy. I have attempted to do so, and here is a
> transcription of my recent events to catch you up to me:  ...and by the way
> thanks, john
> 
> I was working in MySQL under user:john, which has direct privelages to all
> features of MySQL. ...Anyway thinking I was root, I called on "init.d" and
> told mysql to stop.
> 
> [john@ns1 bin]$ /etc/rc.d/init.d/./mysql stop
> Killing mysqld with pid 25268
> kill: (25268) - Not owner
> [john@ns1 bin]$ /etc/rc.d/init.d/./mysql start
> [john@ns1 bin]$ kill 25268: Operation not permitted
> Starting mysqld daemon with databases from /var/lib/mysql
> mysqld daemon ended
> 
> Then I attempted to start mysql and was notified I was not authorized. DOH,
> I am logged in as john. So, I su'd and told mysql to start, and mysql said
> no, aint gonna do it, not in those terms, but to be more specific:
> 
> [john@ns1 bin]$ su
> Password:
> [root@ns1 bin]# /etc/rc.d/init.d/./mysql start
> [root@ns1 bin]# Starting mysqld daemon with databases from /var/lib/mysql
> mysqld daemon ended
> 
> .looking around for some hint:
> went to dir mysql
> ls -la revealed the following:
> ns1.acculock.com.err and .ns1.acculock.com.err.swp
> mv'd the files to the test dir and attempted to restart, but mysql bombed
> again with the same message from start, and recreated the files.
> 
> .looking for answers:
> ps aux revealed the following:
> USER   PID %CPU %MEM  SIZE   RSS TTY STAT START   TIME COMMAND
> root  8374  0.0  0.0  1668 0  ?  SW Oct 28   0:00 (safe_mysqld)
> 
> [root@ns1 init.d]# kill 8374 (returns after nothing was done)
> ps aux revealed the same after attempt to kill process.
> Whew! someone, please? help?
> 
> John
> 
> 
> >From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
> 
> >Wow John... Sounds like you are in deep chit... Just kidding...  Linux 6
> >doesn't say which distro it is, same with mysql 3, there are a bunch of
> >mysql version3s out there.
> 
> >Your problem...
> 
> >Log into as root then restart it.
> 
> >>-Original Message-
> >>From: john [mailto:[EMAIL PROTECTED]]
> 
> Please help with ignorance, I was in mysqld making some changes to a
> database. I run a Linux 6 box with MySQL 3 on it. I was logged in as
> user
> john, who has all access privelages to mysqld. John is not root, and I
> told
> mysql to stop. Well, mysql will not start again. What can I do?
> 
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Mysql client question

2002-04-04 Thread Steven Hajducko

Alright, this may come across as a stupid question -

In the mysql client, is there any way to get rid of the damn -> sign
when you are writing a query out?

I ask because it'd make it alot easier to copy and paste the query back
in, if lets say, I messed up on a single item.

mysql> create table locations( address varchar(255) not null,
-> city varchar(100) not null,
-> state varchar(50),
-> country_id int not null)
-> PRIMARY KEY ( address, city, country_id );
ERROR 1064: You have an error in your SQL syntax near 'PRIMARY KEY (
address, city, country_id )' at line 5

If the damn '->' wasn't before each line, I could just copy and paste
and correct the error.  Anyone know how to get rid of it? \:

--
sh



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




SQL join question

2002-04-03 Thread Steven Hajducko

Alright, I've got a little bit of a problem with this query.

This is what the current query looks like ( I know I'm doing it wrong, I
just don't know how to fix it.. I'm not that familiar with the LEFT
JOIN/subquery stuff.. )

select cluster.cid, cluster.isp, cluster.country_id-20 as
Country_ID, cluster.site_id,
-> count(compaq.id) as Compaq,
-> count(foundry.id) as Foundry,
-> count(netapp.id) as Netapp,
-> count(cisco.id) as Cisco 
-> from cluster LEFT JOIN compaq on cluster.cid = compaq.cid and
compaq.active="Y"
-> LEFT JOIN netapp ON cluster.cid = netapp.cid and
netapp.active="Y"
-> LEFT JOIN foundry ON cluster.cid = foundry.cid and
foundry.active="Y"
-> LEFT JOIN cisco ON cluster.cid = cisco.cid and cisco.active="Y"
-> where ( cluster.ctype="Streaming" and cluster.active="Y" )
-> group by cluster.cid;

Basically I have a 'cluster' table, with a 'cid' key.  Then I have 4
equipment tables ( foundry, netapp, cisco, compaq ) that link back to
the cluster table via the 'cid'.

What I'd like is to get all the clusters and a count of each piece of
ACTIVE equipment that links to it.. ( we have equipment linked to the
cluster table that is considered inactive.. I do not want to include
those in the query. )

Something that would look like this -
+-+---+--+---+--+---+--+---+
| cid | isp   |Country_ID|site_id|Compaq|Foundry|Netapp| Cisco |
+-+--+---+--+---+--+---+
| 287 | Concentric|   200| 31|4 | 2 |1 | 1 |


The problem is I end up with something like this -
+-+---+--+---+--+---+--+---+
| cid | isp   |Country_ID|site_id|Compaq|Foundry|Netapp| Cisco |
+-+--+---+--+---+--+---+
| 287 | Concentric|   200| 31|8 | 8 |8 | 8 |

It seems to be combining all the counts.  I can see *why* it's doing
that in the query, but I'm not sure what the correct statement would be
to fix this?  I could do this with perl/dbi, but I'm trying to stay away
from doing 5 queries to get this information.

Any help appreciated.

Thanks,

sh


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Backups

2002-03-29 Thread Steven Hajducko

Personally I just tar up the data dir every hour and have a script to
rotate the tar file ( up to 10 tar files.. ).

There are some other utilities out there that are nicer tho.  I can't
remember them off the top of my head tho.

--
sh

On Fri, 2002-03-29 at 11:05, Tab Alleman wrote:
> What do you folks out there do to backup your MySQL databases?  I'm new
> to it and am wondering if there's a good utility for doing it, or some
> simple procedure that is already known to be effective and efficient.
>  
> Thanks,
> Tab
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Error 2002:

2002-03-29 Thread Steven Hajducko

Hey Andy,

mysql is the client connection program.  mysqld is the actual mysql
database daemon that runs.

You might want to take a look at the error logs to see what it's
actually complaining about.

That, or go peek at the Mysql documentation first and read up on the
actual install so you can get a better understanding of how all the
pieces fit together.

--
sh

On Fri, 2002-03-29 at 09:04, Andy Jacobs wrote:
> Good afternoon one and all,
> 
> Well, I took the plunge and am trying to get to grips with this Linux and
> have fallen at the first hurdle with MySQL.  When I type mysql from my
> shell prompt (logged in as root) I get the following message
> 
> ERROR 2002: Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (111)
> 
> I've done some searching and it looks like mysqld needs starting so I ran
> safe_mysqld & and got this:
> 
> [root@Linux /root]# Starting mysqld daemon with databases from
> /var/lib/mysql
> 020329 16:49:58  mysqld ended
> 
> I know I must have missed something obvious but if anyone could give me
> any pointers I'd be grateful.
> 
> Andy
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: MYSQL REPLICATION

2002-03-28 Thread Steven Hajducko

Let's say A and B are running together.

Then someone does a large update query and A is done with, while B is in
the middle of it, and A crashes.

You can switch over to B, which won't contain the data, but it'll have a
good snapshot of what the data was before the crash.

When you recover the A machine, ( if you recover it.. ) and restart, B
will catch up from where A left off.  Remember, however, that if you
update B while A is down, A won't have that data. ( Which is what I
think you're asking about? )

This is like any backup solution or when you are replicating anywhere
for redundancy.  You can only backup so much before a crash happens. 
When you do crash, then you at least have a good starting point of data.

If you're asking about an actual recovery process.. Let's say B becomes
the master machine for awhile.  When the A machine is recovered, you
take a snapshot of B's data and put it over on A.  Then start A and have
it slave to B and it will catch up from that point.

If you want actual instructions, just think of creating A as a new slave
to B.  Follow the instructions in the mysql docs about creating a slave.

--
sh

On Thu, 2002-03-28 at 14:54, Joe Bifano wrote:
> I am trying to configure mysql for redundancy using replication and the
> built-in mysql master/slave configuration. What I don't understand, even
> after much reading, is how to recover from a failure. If host B is slave to
> host A, and A goes down, B could then be manually or automatically
> configured to be master itself, and thus take over A's role completely.
> However, if B was not completely caught up from A before the failure took
> place, then once A was back up the two would be out of sync, and A could
> contain data B did not, and B would undoubtedly contain data A did not. How
> do you avoid this situation or re-sync the two after a failure like this?
> 
> I'm finding it difficult to locate a concise and cohesive method to create a
> redundant database system using mysql. Any other resources or references
> would be heartily appreciated.
> 
> Joe
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: queries ( your help appreciated)

2002-03-28 Thread Steven Hajducko

D'oh.  Forgot he wanted after now :)

Thanks.

On Thu, 2002-03-28 at 10:46, DL Neil wrote:
> David, Steven,
> 
> > I think this is what you want?
> >
> > select * from table order by date_column ASC; ( for ascending order..)
> > select * from table order by date_column DESC; ( for descending
> order..)
> >
> > Replace 'table' with the name of your table and date_column with the
> > name of the column that contains the dates.
> 
> ...and add a clause to take care of the temporal constraint, eg
> 
> WHERE dateColNm > NOW()
> 
> (depending upon the format of the date column)
> 
> Recommend a quick look at the manual - it has a quick intro/tutorial
> chapter that covers this ground quite neatly!
> 
> Regards,
> =dn
> 
> 
> > > I am quite new to coding and have managed so far but, i've been
> havin
> > > trouble with queries.
> > > Okay well here goes, it is quite simple but i can't figure it out,
> and
> > > haven't found any helpfull documentation
> > >
> > > I have a mysql database, and i want to sort a table by date Where
> the
> > > resulting records will be greater than (i.e. tommorow) ttodays date
> > >
> > > If someone could give me an example code of how it is done, it would
> be much
> > > appreciated
> > >
> > > thanks,
> > > -dave
> > >
> > >
> > >
> > > _
> > > Chat with friends online, try MSN Messenger:
> http://messenger.msn.com
> > >
> > >
> >
> > -
> > > Before posting, please check:
> > >http://www.mysql.com/manual.php   (the manual)
> > >http://lists.mysql.com/   (the list archive)
> > >
> > > To request this thread, e-mail <[EMAIL PROTECTED]>
> > > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > > Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
> > >
> >
> >
> >
> > -
> > Before posting, please check:
> >http://www.mysql.com/manual.php   (the manual)
> >http://lists.mysql.com/   (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> >
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Repost

2002-03-28 Thread Steven Hajducko

Is there a master.info file somewhere?

What's your my.cnf look like?

If you want, you can email me the file and I'll be happy to try and
help.

--
sh

On Thu, 2002-03-28 at 10:40, Jonathan Wilzig wrote:
> Sorry to repost. I got one answer and stumped the guy trying to help (thanks
> again btw). If anyone has seen this or has any ideas, any help would be
> greatly appreciated.
> 
> ---
> RH 7.2.
> mysql-3.23.44
> 
> I have a single server running mysql. I have added one database I use. For
> some unknown reason, it appears that mysql is trying to replicate to
> something, failing and causing mysql to stop responding almost daily.
> /etc/my.cnf has no reference to any master/slave or replication options. I
> am thoroughly confused. Any help would be appreciated. My hostname.err log
> is filled with lines like this (about 1 per minute)
> 
> 
> 020326 10:18:58  Slave thread: error connecting to master: Unknown MySQL
> Server Host '' (4) (107), retry in 60 sec
> 
> Thanks in advance.
> 
> -
> Jonathan Wilzig
> Wireless Services Corp.
> [EMAIL PROTECTED]
> 
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: queries ( your help appreciated)

2002-03-28 Thread Steven Hajducko

Hey David.

I think this is what you want?

select * from table order by date_column ASC; ( for ascending order..)
select * from table order by date_column DESC; ( for descending order..)

Replace 'table' with the name of your table and date_column with the
name of the column that contains the dates.

--
sh

On Thu, 2002-03-28 at 10:15, David Rice wrote:
> I am quite new to coding and have managed so far but, i've been havin 
> trouble with queries.
> Okay well here goes, it is quite simple but i can't figure it out, and 
> haven't found any helpfull documentation
> 
> I have a mysql database, and i want to sort a table by date Where the 
> resulting records will be greater than (i.e. tommorow) ttodays date
> 
> If someone could give me an example code of how it is done, it would be much 
> appreciated
> 
> thanks,
> -dave
> 
> 
> 
> _
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Replication Failure (or Bug?): Cannot Connect, but Should?

2002-03-27 Thread Steven Hajducko

Leonard,

What command are you using to start the slave server?  I was thinking
maybe it wasn't reading the correct configuration file?

This one is pretty strange.  Have you thought about upgrading the slave
mysql version, just to disregard that it might be a problem between the
two versions?

One thing, in your user table, are you using the hostname of the slave
server to specify where it's coming from?  ( I know you said you did %
already, so this shouldn't matter.. but.. who knows? ).

Here's what my replication user looks like -

| %| bkup   | password | N   | N   | N   |
N   | N   | N | N   | N |
N| Y | N  | N   | N  |
N  |

What do you currently have in the mysql 'user' table for the repl user?

--
sh

On Wed, 2002-03-27 at 17:18, Leonard Megliola wrote:
> 
> Thanks Scott.  It looks like permissions could be the issue, but checking 
> out the table shows that I have all of the correct permissions setup 
> exactly as you have listed them below.
> 
> If you have any other ideas, I'd appreciate them.
> 
> Thanks,
> 
> Leonard
> 
> At 12:49 PM 3/27/2002 -0500, you wrote:
> >Leonard,
> >
> > This is pretty clearly (IMHO) a permissions issue.  Make sure the
> >username you use to replicate with, has a '%' in the Host field of the user
> >table.
> >
> >mysql> use mysql
> >mysql> select * from user where user = '' \G
> >*** 1. row ***
> >Host: %
> >User: 
> >Password: 
> > Select_priv: N
> > Insert_priv: N
> > Update_priv: N
> > Delete_priv: N
> > Create_priv: N
> >   Drop_priv: N
> > Reload_priv: N
> >   Shutdown_priv: N
> >Process_priv: N
> >   File_priv: Y
> >  Grant_priv: N
> >References_priv: N
> >  Index_priv: N
> >  Alter_priv: N
> >1 row in set (0.01 sec)
> >
> >
> >Scott Helms
> >Director of Technology, ZCorum
> >
> >
> >- Original Message -
> >From: "Leonard Megliola" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, March 27, 2002 12:16 PM
> >Subject: Re: Replication Failure (or Bug?): Cannot Connect, but Should?
> >
> >
> > >
> > > Sorry to bring this up again, but I haven't received any helpful
> > > responses.  Does anyone have any clues about this or is this something I
> > > should report as a bug?  I can't imagine it is.
> > >
> > > Thank you,
> > >
> > > Leonard
> > >
> > > At 12:43 AM 3/26/2002 -0800, you wrote:
> > >
> > > >Hello,
> > > >
> > > >I have been attempting to get replication working for a week now and am
> > > >having little luck. I have followed the instructions in the documentation
> > > >but get the following errors in the error log on the slave server:
> > > >
> > > >020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is
> >not
> > > >allowed to connect to this MySQL server(0), retry in 0 sec
> > > >020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is
> >not
> > > >allowed to connect to this MySQL server(0), retry in 0 sec
> > > >020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is
> >not
> > > >allowed to connect to this MySQL server(0), retry in 0 sec
> > > >020325 0:32:24 Slave thread: error connecting to master:Can't connect to
> >
> > > >MySQL server on '0' (11)(107), retry in 0 sec
> > > >020325 0:32:24 Slave thread: error connecting to master:Can't connect to
> > > >MySQL server on '0' (11)(107), retry in 0 sec
> > > >020325 0:32:24 Slave thread: error connecting to master:Can't connect to
> > > >MySQL server on '0' (11)(107), retry in 0 sec
> > > >
> > > >Here are the relevant lines from my configuration files
> > > >
> > > >Master my.cnf:
> > > >[mysqld]
> > > >socket=/var/lib/mysql/mysql.sock
> > > >log-bin
> > > >server-id=1
> > > >
> > > >Slave my.cnf:
> > > >[mysqld]
> > > >socket=/var/lib/mysql/mysql.sock
> > > >master-host=10.0.0.10
> > > >master-user=repl
> > > >master-password=password
> > > >master-connect-retry=10
> > > >master-port=3306
> > > >server-id=2
> > > >
> > > >I created the repl account on the master and have tried giving it FILE
> > > >privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the
> > > >slave server.
> > > >
> > > >The thing that stands out most for me about the error messages is that it
> > > >says "Can't connect to MySQL server on '0'" when I have clearly entered
> > > >the IP address, and that it says retrying in 0 seconds when I made the
> > > >timeout 10 seconds.
> > > >
> > > >The MySQL version on the master server is 3.23.35 and the slave version
> >is
> > > >at 3.23.32.
> > > >
> > > >Any help would be greatly appreciated.
> > > >
> > > >Thanks,
> > > >
> > > >Leonard
> > > >
> > > >P.S. sql query
> > > >
> > > >
> > > >-
> > > >Before posting, please check:
> > > >   http://www.mysql.com/manual.php   (

Re: how to check if table exists?

2002-03-27 Thread Steven Hajducko

You can do a couple of things..

Are you using any other language besides SQL? ( perl, PHP? )

If you're just looking for a way to do it with sql.. you can try -

show tables like "tablename";

It'll either give an empty set, or return the tablename.

--
sh

On Wed, 2002-03-27 at 14:29, Ken Anderson wrote:
> 
> 
> 
> 
>  
>  What is the fastest way to check if a table exists?
>  Do a select and catch the error?
>  Try to create the table, and catch the error?
>  Other options?
>  Thanks,
>  Ken
> 
> sql,query
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: sum of a column

2002-03-27 Thread Steven Hajducko

select sum(col) from tab;

On Wed, 2002-03-27 at 13:32, Aman Raheja wrote:
> Hi all
> How do I get the sum of all values in a column 'col' of a table 'tab'
> I am using CGI-Perl and mysql.
> Thank you.
> Aman
> 
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Replication Failure (or Bug?): Cannot Connect, but Should?

2002-03-27 Thread Steven Hajducko

Hrm, I'll take a stab at it, since I've got replication working atm...

Have you tried basic connectivity tests between the slave and master? (
Just making sure.. ie - can you telnet to port 3306 on the master, from
the slave? )

Did you flush the privileges after adding the repl user?

Here's my master my.cnf -

[mysqld]
port= 3306
socket  = /tmp/mysql.sock
skip-locking
skip-innodb
set-variable= key_buffer=16M
set-variable= max_allowed_packet=1M
set-variable= table_cache=64
set-variable= sort_buffer=512K
set-variable= net_buffer_length=8K
set-variable= myisam_sort_buffer_size=8M
log-bin
server-id   = 1

And slave my.cnf -

[mysqld]
port= 3306
socket  = /tmp/mysql.sock
skip-locking
skip-innodb
set-variable= key_buffer=16M
set-variable= max_allowed_packet=1M
set-variable= table_cache=64
set-variable= sort_buffer=512K
set-variable= net_buffer_length=8K
set-variable= myisam_sort_buffer_size=8M
log-bin
server-id   = 2

master-host=db.mine.com
master-user=bkup
master-password=password
master-port=3306

Can you copy and paste your whole my.cnf from the slave? It doesn't
sound like it's reading it correctly ( maybe why it's keeping the
timeout at 0 and trying to connect to the wrong ip? )

--
sh

On Wed, 2002-03-27 at 09:16, Leonard Megliola wrote:
> 
> Sorry to bring this up again, but I haven't received any helpful 
> responses.  Does anyone have any clues about this or is this something I 
> should report as a bug?  I can't imagine it is.
> 
> Thank you,
> 
> Leonard
> 
> At 12:43 AM 3/26/2002 -0800, you wrote:
> 
> >Hello,
> >
> >I have been attempting to get replication working for a week now and am 
> >having little luck. I have followed the instructions in the documentation 
> >but get the following errors in the error log on the slave server:
> >
> >020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not 
> >allowed to connect to this MySQL server(0), retry in 0 sec
> >020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not 
> >allowed to connect to this MySQL server(0), retry in 0 sec
> >020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not 
> >allowed to connect to this MySQL server(0), retry in 0 sec
> >020325 0:32:24 Slave thread: error connecting to master:Can't connect to 
> >MySQL server on '0' (11)(107), retry in 0 sec
> >020325 0:32:24 Slave thread: error connecting to master:Can't connect to 
> >MySQL server on '0' (11)(107), retry in 0 sec
> >020325 0:32:24 Slave thread: error connecting to master:Can't connect to 
> >MySQL server on '0' (11)(107), retry in 0 sec
> >
> >Here are the relevant lines from my configuration files
> >
> >Master my.cnf:
> >[mysqld]
> >socket=/var/lib/mysql/mysql.sock
> >log-bin
> >server-id=1
> >
> >Slave my.cnf:
> >[mysqld]
> >socket=/var/lib/mysql/mysql.sock
> >master-host=10.0.0.10
> >master-user=repl
> >master-password=password
> >master-connect-retry=10
> >master-port=3306
> >server-id=2
> >
> >I created the repl account on the master and have tried giving it FILE 
> >privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the 
> >slave server.
> >
> >The thing that stands out most for me about the error messages is that it 
> >says "Can't connect to MySQL server on '0'" when I have clearly entered 
> >the IP address, and that it says retrying in 0 seconds when I made the 
> >timeout 10 seconds.
> >
> >The MySQL version on the master server is 3.23.35 and the slave version is 
> >at 3.23.32.
> >
> >Any help would be greatly appreciated.
> >
> >Thanks,
> >
> >Leonard
> >
> >P.S. sql query
> >
> >
> >-
> >Before posting, please check:
> >   http://www.mysql.com/manual.php   (the manual)
> >   http://lists.mysql.com/   (the list archive)
> >
> >To request this thread, e-mail <[EMAIL PROTECTED]>
> >To unsubscribe, e-mail 
> ><[EMAIL PROTECTED]>
> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> 
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: RSA encrypted strings - what data type?

2002-03-26 Thread Steven Hajducko

Well, I screwed around with it.  This is what I got ( just in case
anybody cares.. )

( this is in perl, using the Crypt::RSA module.. )

$password = "screwyou!";

# encrypts the 'password'...
$cyphertext = $rsa->encrypt(Message=>$password, Key=>$pub);

# now convert the RSA encrypted key to binary.
$bin_str = unpack("B*", pack("u*", $cyphertext));

# now reconvert it back to uuencode..
$recypher = unpack("u*",pack("B*", $bin_str));

# then decrypt it.
$plaintext = $rsa->decrypt(Cyphertext=>$recypher, Key=>$priv);

# prints "screwyou!"
print "$plaintext\n";

Mysql has no trouble keeping the binary version.

Thanks for the help guys,

Steve

On Tue, 2002-03-26 at 14:35, Christopher Thompson wrote:
> On Tuesday 26 March 2002 3:26 pm, Steven Hajducko wrote:
> >
> > I'm trying to take a string ( In this case, a password ), and encrypt it
> > with RSA encryption via the perl module, Crypt::RSA.  Later on, I want
> > to be able to pull the encrypted string back out and decrypt it.
> 
> Note that if you do this, you must hard-code the key somewhere (unless you 
> are prompting the user for it) which means you are simply obfuscating the 
> data, not actually encrypting it.
> 
> > One of three things happens when I do this however.
> >
> > 1) Everything works fine.
> > 2) I cannot insert the encrypted string.
> > 3) The encrypted string is inserted, but incorrectly and will not
> > decrypt.
> >
> > I tried using a blob or medium blob for the datatype, but neither will
> > work 100% of the time.  Has anyone done this before with a Mysql db and
> > if so, how? What sort of datatype do you use for the field that will
> > contain the encrypted string?  Did you use a different type of
> > encryption method? ( Keep in mind that I cannot use a one way encryption
> > scheme for this. )
> 
> You need a blob.  Are you sure you are storing the data as binary?  
> Alternatively, it is probably of fixed size and so you could just store the 
> resulting chunk of data as a series of 8 bit values.
> 
> Note that if you do not need to be able to recover the password, just verify 
> whether the password a user typed is correct, you CAN and, in fact, SHOULD 
> use a one-way hash instead of an encryption.
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: RSA encrypted strings - what data type?

2002-03-26 Thread Steven Hajducko

On Tue, 2002-03-26 at 14:35, Christopher Thompson wrote:
> On Tuesday 26 March 2002 3:26 pm, Steven Hajducko wrote:
> >
> > I'm trying to take a string ( In this case, a password ), and encrypt it
> > with RSA encryption via the perl module, Crypt::RSA.  Later on, I want
> > to be able to pull the encrypted string back out and decrypt it.
> 
> Note that if you do this, you must hard-code the key somewhere (unless you 
> are prompting the user for it) which means you are simply obfuscating the 
> data, not actually encrypting it.

The user has to specify this.  There are 2 ( sets of ) keys.  One goes
to each department.  The scripts require the specification of the key or
the location of the key.

> 
> > One of three things happens when I do this however.
> >
> > 1) Everything works fine.
> > 2) I cannot insert the encrypted string.
> > 3) The encrypted string is inserted, but incorrectly and will not
> > decrypt.
> >
> > I tried using a blob or medium blob for the datatype, but neither will
> > work 100% of the time.  Has anyone done this before with a Mysql db and
> > if so, how? What sort of datatype do you use for the field that will
> > contain the encrypted string?  Did you use a different type of
> > encryption method? ( Keep in mind that I cannot use a one way encryption
> > scheme for this. )
> 
> You need a blob.  Are you sure you are storing the data as binary?  
> Alternatively, it is probably of fixed size and so you could just store the 
> resulting chunk of data as a series of 8 bit values.

That's what I figured.  I'm probably trying to store the data
incorrectly.  I guess this is where I'll start looking.

> 
> Note that if you do not need to be able to recover the password, just verify 
> whether the password a user typed is correct, you CAN and, in fact, SHOULD 
> use a one-way hash instead of an encryption.

As I said, I can't use one way :)  The passwords need to be recovered,
not verified.



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RSA encrypted strings - what data type?

2002-03-26 Thread Steven Hajducko

Hi,

I'm new to the list and I joined because I couldn't figure out the
answer to this problem.

I'm trying to take a string ( In this case, a password ), and encrypt it
with RSA encryption via the perl module, Crypt::RSA.  Later on, I want
to be able to pull the encrypted string back out and decrypt it.

One of three things happens when I do this however.

1) Everything works fine.
2) I cannot insert the encrypted string.
3) The encrypted string is inserted, but incorrectly and will not
decrypt.

I tried using a blob or medium blob for the datatype, but neither will
work 100% of the time.  Has anyone done this before with a Mysql db and
if so, how? What sort of datatype do you use for the field that will
contain the encrypted string?  Did you use a different type of
encryption method? ( Keep in mind that I cannot use a one way encryption
scheme for this. )

Thanks,

Steve



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php