Re: Backing up all MySQL DBs

2003-09-10 Thread Jerry M. Howell II
On Tue, Sep 09, 2003 at 06:47:52AM -0700, Will Glass-Husain wrote:
> 
> 
> There's also
> 
> # backup databases
> for dbname in `echo 'show databases;' |  mysql -u$dbuser -p$dbpassword`
> do
> echo "Backing up database $dbname..."  >>
> $destdir/backup.log
> mysqldump -u$dbuser -p$dbpassword $dbname | zip -q9
> $destdir/db_$dbname.zip - >> $destdir/backup.log
> done
> 
> 
This is the metod I use as it makes it easier to replace 1 database
ifone of my clients screw it up. It's happened at least a few times
already. I just add it into a script and copy it to the apropriate
directory only part I'd add it the date apended to the filename. Just
incase you need to restore a backup from a week ago instead of just
yesterday.
-- 
Jerry M. Howell II

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



Re: ERROR 1045: Access denied for user: 'root@localhost' (Using p assword: YES)

2003-09-05 Thread Jerry M. Howell II
I figured it out. Actualy silly me forgot to add the password() function
how embarising. :)
-- 
Jerry M. Howell II

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



Re: ERROR 1045: Access denied for user: 'root@localhost' (Using p assword: YES)

2003-09-05 Thread Jerry M. Howell II
> now allowing clients to login but I'm not sure what would cuse it not to
> allow root to change the password, I dubble and triple checked my entry
> but still nothing happens. Once I login to root I do the following
> 
> mysql> use mysql
> mysql> UPDATE user SET Password= ('x')
> -> WHERE user='root';
> 
> Here is the response I get
> 
> Query OK, 0 rows affected (0.01 sec)
> Rows matched: 4  Changed: 0  Warnings: 0
> 
> Not sure why nothing is changed? Anyideas. Might root not have the
> privlage? if so, how might I be able to change the password?
> -- 
> Jerry M. Howell II
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 

Just disregard that last post. I tried to change the password to the
same password. Still, it's not letting root login with a set password.

-- 
Jerry M. Howell II

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



Re: ERROR 1045: Access denied for user: 'root@localhost' (Using p assword: YES)

2003-09-05 Thread Jerry M. Howell II
On Fri, Sep 05, 2003 at 01:34:01PM -0400, Fortuno, Adam wrote:
> Jerry,
> 
> Don't forget that MySQL authenticates an entity, which is based on the user
> name and host. For example, on my MySQL boxes root can only login from the
> localhost. If I attempt to login with root from another host, I am denied
> access.
> 
True, by default it does, I ssh'ed into the mysql server and did it that
way. Actualy it apears that now it's not changeing the password. It's
now allowing clients to login but I'm not sure what would cuse it not to
allow root to change the password, I dubble and triple checked my entry
but still nothing happens. Once I login to root I do the following

mysql> use mysql
mysql> UPDATE user SET Password= ('x')
-> WHERE user='root';

Here is the response I get

Query OK, 0 rows affected (0.01 sec)
Rows matched: 4  Changed: 0  Warnings: 0

Not sure why nothing is changed? Anyideas. Might root not have the
privlage? if so, how might I be able to change the password?
-- 
Jerry M. Howell II

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



ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

2003-09-05 Thread Jerry M. Howell II
Hey there all,

  Here is the problem I am haveing and was wondering if anyone can help
  me here. I was getting the following error when loging into mysql

  ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password:
  YES)

  After searching for an answer I found the answer was to re-start
  using --skip-grant-tables and change the password then restart mysql
  useing the normal startup script. This worked well.

  The next step is where I run into problems. After I log into mysql in
  the normal mode and reset the password I go back to ERROR 1045: Access
  denied for user: '[EMAIL PROTECTED]' (Using password:YES). Also, other
  users are reporting that they can't access thier databases. Based on
  what I am seeing here I am able to login to mysql as root as long as
  there is no password. Once I set a password it wont let me connect.
  Also found that users can't login to the databases.

  Does anyone have any idea whats going on and how I might be able to
  resove this problem?

  
Thanks,
-- 
Jerry M. Howell II

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



Re: mysql database dump (remotely, How?)

2003-06-28 Thread Jerry M. Howell II
On Sat, Jun 28, 2003 at 11:35:54AM -0600, Jerry M. Howell II wrote:
> On Sat, Jun 28, 2003 at 06:14:07PM +1000, electroteque wrote:
> > lol of course
> > 
> > mysqldump -u username -p databasename > databasename.sql
> > 
> 
> I am atempting to backup a database remotely. I added something like the
> following.
> 
> mysql> GRANT ALL PRIVILEGES ON db.*
> -> TO david@'192.58.197.0/255.255.255.0';
> 
> And have access to the database from my home computer now but when I
> use mysqldump -h hostname -A -p > mysql.sql it dumps only a part of
> the backup and closes. Any clues as to what is going on or what I
> need to do? I could always have it backup on the server and scp it
> to my computer but hardheaded me would rather do it simply by
> dumping it from the remote computer to my home puter via mysqldump
> :). Thanks for any help.
> 

Nevermind, I found the issue. Forgot to grant myself permisions to
access, insert modify, etc the tables.

-- 
Jerry M. Howell II

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



Re: mysql database dump (remotely, How?)

2003-06-28 Thread Jerry M. Howell II
On Sat, Jun 28, 2003 at 06:14:07PM +1000, electroteque wrote:
> lol of course
> 
> mysqldump -u username -p databasename > databasename.sql
> 

I am atempting to backup a database remotely. I added something like the
following.

mysql> GRANT ALL PRIVILEGES ON db.*
-> TO david@'192.58.197.0/255.255.255.0';

And have access to the database from my home computer now but when I
use mysqldump -h hostname -A -p > mysql.sql it dumps only a part of
the backup and closes. Any clues as to what is going on or what I
need to do? I could always have it backup on the server and scp it
to my computer but hardheaded me would rather do it simply by
dumping it from the remote computer to my home puter via mysqldump
:). Thanks for any help.

-- 
Jerry M. Howell II

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



Re: Mysql And Backup "found a solution"

2003-03-21 Thread Jerry M. Howell II
atabases?\n";
}

  # Run mysqlhotcopy against all databases.
  foreach my $line (@dblist) {
# Drop the eol char.
$line =~ /^(.*)$/;
my $db = $1;

# Make sure the db is there.  Won't die if it isn't, it just looks
# like I'm not error checking if I omit this.
if ( ! -d $LIVEDBDIR . '/' . $db ){

  # Check to see if the database name is 'Database'.  This is crap
that mysql show databases gives
  # and shouldn't exist.   However, someone could have a database
named "Database" so we want
  # to provide the information.
  if ($db =~ /^Database$/) {
print "Skipping \'$db\'.  Doesn't seem to exist.  This is probably
normal in this case.\n";
  }
  else {
print "Skipping \'$db\'.  Doesn't seem to exist.\n";
  }
  next;
}

print "Copying $db...\n";
# If we got user and password data.  Use it.
if (($sqluser ne '') and ($sqlpass ne '')){
  # System call to copy the database.  Overwrite existing directories.
  system('/usr/bin/mysqlhotcopy --allowold --user=' . $sqluser . '
--password=' . $sqlpass . ' ' . $db . ' ' . $DATADIR . ' 2>&
1>/dev/null');
}
else {
  # System call to copy the database.  Overwrite existing directories.
  system('/usr/bin/mysqlhotcopy --allowold ' . $db . ' ' . $DATADIR .
' 2>&1>/dev/null');
}
compressDB($db);
  }
}
# Function:  compressDB
# This function will tgz all of the copied database directories.
sub compressDB {

  # Grab the dblist.
  my @dblist = @_;

  # Hump the db list.
  foreach my $line (@dblist){
# Strip the EOL char.
$line =~ /^(.*)$/;
my $db = $1;
# If the $DATADIR directory doesn't exist, create it.
if ( -d $DATADIR . '/' . $db) {
  print "Compressing $db...\n";
  # System calls to create the the tarballs and delete the dirs after
doing so.
  system('cd ' . $DATADIR . ';/bin/tar cvzf ' . $db . '.tgz ' . $db .
' 2>&1>/dev/null');
  print "Cleaning up after $db...\n";
  system('rm -rf ' . $DATADIR . '/' . $db . ' 2>&1>/dev/null');
}
  }
}

#
# Main
# -----------

# Global Variable
my @dblist;

# If this is a psa install, get the admin password and generate the DB list.
# Otherwise just generate the DB list using the variables above.
if ($CP =~ /psa/) {
  $sqlpass = getPSAPass;
  @dblist = genDBList('admin',$sqlpass);
  copyDB('admin',$sqlpass,@dblist);
}
else {
  @dblist = genDBList($sqluser,$sqlpass);
  copyDB($sqluser,$sqlpass,@dblist);
}

# Exit -- Ah DUH!
exit 0;

-end code 

OK, a little long for a perlscript but it works, and much faster
than mysql dump

--

Jerry M. Howell II



-
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 And Backup

2003-03-21 Thread Jerry M. Howell II

sunil sharma said:
> Dear Friends
>
> I am new in this list
> I am using mysql on linux
>
> My problem is about the backup of mysql database
>
> We are having 50 Databases and each database is of
> minimum of 300 MB in size and maximum of 2 G.B size
>
> I am planning to take incremental backup of the
> database
> For that i am planning to use mysqldump,But i m bit
> doughtful about the mysqldump because the size of the
> database is very huge
> I tried but it's taking a lot of time
>
funny you asked that my question is similar so I'll
group it with this one, hope you don't mind.

Hello all,

   I have been using mysqldump -a to backup my clients sites.
I have discovered a problem with this aproach. I decided to
try and restore it with mysqlimport on my local hd and it'll
restore it up to a certian point then stop. What I'm looking
for is any other recomendations to backup and restore 71
databases. Any scripts for backing it all up will of course
be welcom as well. second off, how do I wipe these old
databases off my puter :)

thnx,

-- 

Jerry M. Howell II



-
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: encrypted password

2003-02-06 Thread Jerry M. Howell II
On Tue, Feb 04, 2003 at 02:58:28PM -0500, Jianping Zhu wrote:
> 
> I have mysql in a redhat machine. I need to use mysql do user
> authentication to a website.
> I have a table like following.
> 
> +--+--+
> | username | passwd   |
> +--+--+
> | jianping | jian1830 |
> | chichi   | jian1830 |
> +--+--+
> 
> I want the passwd field not to be plain text but encrypted. how can i do
> that?
> 
Not for sure on the exact syntax becuse I've always used myPhpAdmin's
md5 utility but it would be something like 

MD5("jian1830")

this would do an MD5 hash
-- 
Jerry M. Howell II

-
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: Book recomendations

2003-01-08 Thread Jerry M. Howell II
On Wed, Jan 08, 2003 at 08:34:18AM -0500, Charles Mabbott wrote:
> I got a gift certificate for book store.  I am looking for good MySql
> books with reference, examples, etc?  Anyone have some ideas on good 
> books to look at
> 
MySQL by Dubois is a good starter book. Not sure how it works for the
advanced person because I'm not realy advanced but mabe skim through it
if the bookstores have it and see what you think or read the reviews on
the book on bn.com or mabe others on the list could give feedback on
this.

-- 
Jerry M. Howell II

-
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 and php

2002-12-02 Thread Jerry M . Howell II
Thank you Daniel,

   You remided me that I once had a page with the following instead mysql_error()
and that gave me the verbosity that I needed to get things working. Looks like my
wife changed some fields in the database without thinking how they might affect the
script. Can't believe I didn't compare the database to the script in the first place.
gr

On Mon, 2 Dec 2002 23:34:45 -0500
Jerry M. Howell II <[EMAIL PROTECTED]> wrote:

> Error in input query
> 
>  start of php database code *
> 
> $connection = mysql_connect("localhost", "hostbyk1_admin",
> "") or
> die("Invalid
> server or user");
> mysql_select_db("hostbyk1_order",$connection);
> 
> / ***
> Make sure you replace USERS with your table name
> ***/
> $query = "insert into client
> (  last_name,first_name,address,city,
> state,country,zip,phone,email,
> refer,ip_address,package,domain,color,due_date)·
> values('$last_name','$first_name','$address','$city',
> '$state','$country','$zip','$phone','$email',
> '$refer','$ip','$package','$domain','$color','$due_date')";
> /* **
> this is what does the work, if you get this error, you know you·
> connected to the dbase, but something is wrong with your query
> ***/
> $result = mysql_query($query,$connection)or die("Error in input
> query");
>  End of php database code *
> 
> as you can see the username is hostbyk1_admin
> 
> password I actualy changed for obvious reasons
> 
> the database I'm trying to acsess is hostbyk1_order
> 
> and the table name is client
> 
> I also tested it from the command line and can access the
> database just fine
> it might be a scripting error but I've searched the web for
> templates and they
> all seem to use this format so I'm stumped
> 
> On Mon, 2 Dec 2002 23:59:35 -0500
> daniel <[EMAIL PROTECTED]> wrote:
> 
> > this is a vague one , would be good to copy and paste the php debug message
> > >= Original Message From Jerry M. Howell II <[EMAIL PROTECTED]> =
> > >Hello all,
> > >
> > >   We are leasing a dedicated server and seem to pe having problems getting 
> > our
> > >php script working with mysql. The script was working fine with the last 
> > server
> > >we were on so I'm wondering if you all have any sugestions. We are hosting on 
> > a
> > >redhat 7.3 server with MySQL-3.23.53a-1.i386.rpm It would seem they have
> > >MySQL-client-3.23.53a-1.i386.rpm
> > >MySQL-devel-3.23.53a-1.i386.rpm
> > >MySQL-shared-3.23.53a-1.i386.rpm
> > >
> > >We have talked to the ppl that set the server up and they assure us it's a 
> > scripting
> > >error with our php file. That script I will save for the php list unless you 
> > all feal
> > >it's nessisary topost it here. Is there any permision issues I should look 
> > into or
> > >something they might have overlooked in the install? I apreciate any help I 
> > can get
> > >on this issue.
> > >
> > >thnx
> > >--
> > >Jerry M. Howell II
> > >
> > >-
> > >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
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Jerry M. Howell II
> 
> -
> 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
> 
> 
> 


-- 
Jerry M. Howell II

-
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 and php

2002-12-02 Thread Jerry M . Howell II
Error in input query

 start of php database code *

$connection = mysql_connect("localhost", "hostbyk1_admin",
"") or
die("Invalid
server or user");
mysql_select_db("hostbyk1_order",$connection);

/ ***
Make sure you replace USERS with your table name
***/
$query = "insert into client
(  last_name,first_name,address,city,
state,country,zip,phone,email,
refer,ip_address,package,domain,color,due_date)·
values('$last_name','$first_name','$address','$city',
'$state','$country','$zip','$phone','$email',
'$refer','$ip','$package','$domain','$color','$due_date')";
/* **
this is what does the work, if you get this error, you know you·
connected to the dbase, but something is wrong with your query
***/
$result = mysql_query($query,$connection)or die("Error in input
query");
 End of php database code *

as you can see the username is hostbyk1_admin

password I actualy changed for obvious reasons

the database I'm trying to acsess is hostbyk1_order

and the table name is client

I also tested it from the command line and can access the
database just fine
it might be a scripting error but I've searched the web for
templates and they
all seem to use this format so I'm stumped

On Mon, 2 Dec 2002 23:59:35 -0500
daniel <[EMAIL PROTECTED]> wrote:

> this is a vague one , would be good to copy and paste the php debug message
> >= Original Message From Jerry M. Howell II <[EMAIL PROTECTED]> =
> >Hello all,
> >
> >   We are leasing a dedicated server and seem to pe having problems getting 
> our
> >php script working with mysql. The script was working fine with the last 
> server
> >we were on so I'm wondering if you all have any sugestions. We are hosting on 
> a
> >redhat 7.3 server with MySQL-3.23.53a-1.i386.rpm It would seem they have
> >MySQL-client-3.23.53a-1.i386.rpm
> >MySQL-devel-3.23.53a-1.i386.rpm
> >MySQL-shared-3.23.53a-1.i386.rpm
> >
> >We have talked to the ppl that set the server up and they assure us it's a 
> scripting
> >error with our php file. That script I will save for the php list unless you 
> all feal
> >it's nessisary topost it here. Is there any permision issues I should look 
> into or
> >something they might have overlooked in the install? I apreciate any help I 
> can get
> >on this issue.
> >
> >thnx
> >--
> >Jerry M. Howell II
> >
> >-------------
> >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
> 
> 
> 
> 


-- 
Jerry M. Howell II

-
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 and php

2002-12-02 Thread Jerry M . Howell II
Hello all,

   We are leasing a dedicated server and seem to pe having problems getting our
php script working with mysql. The script was working fine with the last server
we were on so I'm wondering if you all have any sugestions. We are hosting on a
redhat 7.3 server with MySQL-3.23.53a-1.i386.rpm It would seem they have
MySQL-client-3.23.53a-1.i386.rpm
MySQL-devel-3.23.53a-1.i386.rpm
MySQL-shared-3.23.53a-1.i386.rpm

We have talked to the ppl that set the server up and they assure us it's a scripting
error with our php file. That script I will save for the php list unless you all feal
it's nessisary topost it here. Is there any permision issues I should look into or
something they might have overlooked in the install? I apreciate any help I can get
on this issue.

thnx
-- 
Jerry M. Howell II

-
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