Re: mysqlimport remote host problem

2009-03-11 Thread Claudio Nanni
zcat /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz | mysql -h
192.168.0.224 -u root -p alba2

Cheers

Claudio



2009/3/11 Rob Wultsch wult...@gmail.com

 On Tue, Mar 10, 2009 at 7:16 PM, René Fournier m...@renefournier.com
 wrote:

  OK, I've managed to do the same thing with just the mysql command line
  program:
 
 mysql -h 192.168.0.224 -u root -p alba2 
  /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql
 
  Works great. However, the sql file is normally gzipped, so Can I
 ungzip
  the file on the fly (and without removing the .gzip version) and pipe the
  contents as I did above? (Yes, I'm UNIX-impaired.)  Something like:
 
 mysql -h 192.168.0.224 -u root -p alba2  gzip -dc
  /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz
 
  But so that it works...
 
  ...Rene


 Pipe is your friend. You probably want something like:

 gzip -dc /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz
 | mysql -h 192.168.0.224 -u root -p alba2



Re: mysqlimport remote host problem

2009-03-11 Thread René Fournier

Thanks. That works great.


On 10-Mar-09, at 9:36 PM, Rob Wultsch wrote:

On Tue, Mar 10, 2009 at 7:16 PM, René Fournier m...@renefournier.com  
wrote:


OK, I've managed to do the same thing with just the mysql command  
line

program:

  mysql -h 192.168.0.224 -u root -p alba2 
/Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql

Works great. However, the sql file is normally gzipped, so Can  
I ungzip
the file on the fly (and without removing the .gzip version) and  
pipe the

contents as I did above? (Yes, I'm UNIX-impaired.)  Something like:

  mysql -h 192.168.0.224 -u root -p alba2  gzip -dc
/Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz

But so that it works...

...Rene



Pipe is your friend. You probably want something like:

gzip -dc /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz
| mysql -h 192.168.0.224 -u root -p alba2



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



mysqlimport remote host problem

2009-03-10 Thread René Fournier
I'm writing script that, each night, copies a small database to my  
laptop on the local network. I'm having trouble getting it to work.  
Here's my syntax so far (run on the server):


mysqlimport --host=192.168.0.224 --user=root --password alba2  
alba2_2009-03-10_00h45m.Tuesday.sql


Which produces:

---
mysqlimport: Error: You have an error in your SQL syntax; check the  
manual that corresponds to your MySQL server version for the right  
syntax to use near '-03-10_00h45m IGNORE 0 LINES' at line 1, when  
using table: alba2_2009-03-10_00h45m

---

The sql file is produced by automysqlbackup...  Not sure what I'm  
missing, probably something obvious. Anyway, here's the first part of  
the sql file I want to import:


-- MySQL Administrator dump 1.4
--
-- --
-- Server version   5.0.67-log


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,  
FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,  
SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;



--
-- Create schema alba2
--

CREATE DATABASE IF NOT EXISTS alba2;
USE alba2;

--
-- Definition of table `alba2`.`accounts`
--

DROP TABLE IF EXISTS `alba2`.`accounts`;
CREATE TABLE  `alba2`.`accounts` (
  `id` smallint(5) unsigned NOT NULL auto_increment,
  `fp` varchar(40) NOT NULL,
  `created` int(10) unsigned NOT NULL default '0',
  `status` enum('Active','Inactive') NOT NULL default 'Active',
  `account_name` varchar(40) NOT NULL,
  `account_full_name` varchar(40) NOT NULL,
  `address` varchar(40) NOT NULL,
  `city` varchar(40) NOT NULL,
  `province` varchar(10) NOT NULL,
  `postcode` varchar(10) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `alba2`.`accounts`
--


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysqlimport remote host problem

2009-03-10 Thread René Fournier
OK, I've managed to do the same thing with just the mysql command line  
program:


	mysql -h 192.168.0.224 -u root -p alba2  /Backup/Latest/ 
alba2_2009-03-10_00h45m.Tuesday.sql


Works great. However, the sql file is normally gzipped, so Can I  
ungzip the file on the fly (and without removing the .gzip version)  
and pipe the contents as I did above? (Yes, I'm UNIX-impaired.)   
Something like:


	mysql -h 192.168.0.224 -u root -p alba2  gzip -dc /Backup/Latest/ 
alba2_2009-03-10_00h45m.Tuesday.sql.gz


But so that it works...

...Rene

On 10-Mar-09, at 7:38 PM, René Fournier wrote:

I'm writing script that, each night, copies a small database to my  
laptop on the local network. I'm having trouble getting it to work.  
Here's my syntax so far (run on the server):


mysqlimport --host=192.168.0.224 --user=root --password alba2  
alba2_2009-03-10_00h45m.Tuesday.sql


Which produces:

---
mysqlimport: Error: You have an error in your SQL syntax; check the  
manual that corresponds to your MySQL server version for the right  
syntax to use near '-03-10_00h45m IGNORE 0 LINES' at line 1, when  
using table: alba2_2009-03-10_00h45m

---

The sql file is produced by automysqlbackup...  Not sure what I'm  
missing, probably something obvious. Anyway, here's the first part  
of the sql file I want to import:


-- MySQL Administrator dump 1.4
--
-- --
-- Server version   5.0.67-log


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,  
FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,  
SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;



--
-- Create schema alba2
--

CREATE DATABASE IF NOT EXISTS alba2;
USE alba2;

--
-- Definition of table `alba2`.`accounts`
--

DROP TABLE IF EXISTS `alba2`.`accounts`;
CREATE TABLE  `alba2`.`accounts` (
 `id` smallint(5) unsigned NOT NULL auto_increment,
 `fp` varchar(40) NOT NULL,
 `created` int(10) unsigned NOT NULL default '0',
 `status` enum('Active','Inactive') NOT NULL default 'Active',
 `account_name` varchar(40) NOT NULL,
 `account_full_name` varchar(40) NOT NULL,
 `address` varchar(40) NOT NULL,
 `city` varchar(40) NOT NULL,
 `province` varchar(10) NOT NULL,
 `postcode` varchar(10) NOT NULL,
 UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `alba2`.`accounts`
--


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub...@renefournier.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysqlimport remote host problem

2009-03-10 Thread Darryle Steplight
Hi Rene,
 Just a head's up. You might want to keep your username/password
credentials private.

On Tue, Mar 10, 2009 at 10:16 PM, René Fournier m...@renefournier.com wrote:
 OK, I've managed to do the same thing with just the mysql command line
 program:

        mysql -h 192.168.0.224 -u root -p alba2 
 /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql

 Works great. However, the sql file is normally gzipped, so Can I ungzip
 the file on the fly (and without removing the .gzip version) and pipe the
 contents as I did above? (Yes, I'm UNIX-impaired.)  Something like:

        mysql -h 192.168.0.224 -u root -p alba2  gzip -dc
 /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz

 But so that it works...

 ...Rene

 On 10-Mar-09, at 7:38 PM, René Fournier wrote:

 I'm writing script that, each night, copies a small database to my laptop
 on the local network. I'm having trouble getting it to work. Here's my
 syntax so far (run on the server):

 mysqlimport --host=192.168.0.224 --user=root --password alba2
 alba2_2009-03-10_00h45m.Tuesday.sql

 Which produces:

 ---
 mysqlimport: Error: You have an error in your SQL syntax; check the manual
 that corresponds to your MySQL server version for the right syntax to use
 near '-03-10_00h45m IGNORE 0 LINES' at line 1, when using table:
 alba2_2009-03-10_00h45m
 ---

 The sql file is produced by automysqlbackup...  Not sure what I'm missing,
 probably something obvious. Anyway, here's the first part of the sql file I
 want to import:

 -- MySQL Administrator dump 1.4
 --
 -- --
 -- Server version       5.0.67-log


 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
 /*!40101 SET NAMES utf8 */;

 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
 FOREIGN_KEY_CHECKS=0 */;
 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'
 */;


 --
 -- Create schema alba2
 --

 CREATE DATABASE IF NOT EXISTS alba2;
 USE alba2;

 --
 -- Definition of table `alba2`.`accounts`
 --

 DROP TABLE IF EXISTS `alba2`.`accounts`;
 CREATE TABLE  `alba2`.`accounts` (
  `id` smallint(5) unsigned NOT NULL auto_increment,
  `fp` varchar(40) NOT NULL,
  `created` int(10) unsigned NOT NULL default '0',
  `status` enum('Active','Inactive') NOT NULL default 'Active',
  `account_name` varchar(40) NOT NULL,
  `account_full_name` varchar(40) NOT NULL,
  `address` varchar(40) NOT NULL,
  `city` varchar(40) NOT NULL,
  `province` varchar(10) NOT NULL,
  `postcode` varchar(10) NOT NULL,
  UNIQUE KEY `id` (`id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

 --
 -- Dumping data for table `alba2`.`accounts`
 --


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql?unsub...@renefournier.com



 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql?unsub=dstepli...@gmail.com



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysqlimport remote host problem

2009-03-10 Thread wultsch
Note the space after the -p , alba2 will be the defaut database *after* he is 
prompted and corrctly give the password for r...@whateverhishostis . 

As he did not give the password, and is not connecting to an that one could get 
to from the net he really has not given out particularly useful info if we had 
ill intents.


Sent from my Verizon Wireless BlackBerry

-Original Message-
From: Darryle Steplight dstepli...@gmail.com

Date: Tue, 10 Mar 2009 22:20:26 
To: René Fournierm...@renefournier.com
Cc: mysqlmysql@lists.mysql.com
Subject: Re: mysqlimport remote host problem


Hi Rene,
 Just a head's up. You might want to keep your username/password
credentials private.

On Tue, Mar 10, 2009 at 10:16 PM, René Fournier m...@renefournier.com wrote:
 OK, I've managed to do the same thing with just the mysql command line
 program:

        mysql -h 192.168.0.224 -u root -p alba2 
 /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql

 Works great. However, the sql file is normally gzipped, so Can I ungzip
 the file on the fly (and without removing the .gzip version) and pipe the
 contents as I did above? (Yes, I'm UNIX-impaired.)  Something like:

        mysql -h 192.168.0.224 -u root -p alba2  gzip -dc
 /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz

 But so that it works...

 ...Rene

 On 10-Mar-09, at 7:38 PM, René Fournier wrote:

 I'm writing script that, each night, copies a small database to my laptop
 on the local network. I'm having trouble getting it to work. Here's my
 syntax so far (run on the server):

 mysqlimport --host=192.168.0.224 --user=root --password alba2
 alba2_2009-03-10_00h45m.Tuesday.sql

 Which produces:

 ---
 mysqlimport: Error: You have an error in your SQL syntax; check the manual
 that corresponds to your MySQL server version for the right syntax to use
 near '-03-10_00h45m IGNORE 0 LINES' at line 1, when using table:
 alba2_2009-03-10_00h45m
 ---

 The sql file is produced by automysqlbackup...  Not sure what I'm missing,
 probably something obvious. Anyway, here's the first part of the sql file I
 want to import:

 -- MySQL Administrator dump 1.4
 --
 -- --
 -- Server version       5.0.67-log


 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
 /*!40101 SET NAMES utf8 */;

 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
 FOREIGN_KEY_CHECKS=0 */;
 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'
 */;


 --
 -- Create schema alba2
 --

 CREATE DATABASE IF NOT EXISTS alba2;
 USE alba2;

 --
 -- Definition of table `alba2`.`accounts`
 --

 DROP TABLE IF EXISTS `alba2`.`accounts`;
 CREATE TABLE  `alba2`.`accounts` (
  `id` smallint(5) unsigned NOT NULL auto_increment,
  `fp` varchar(40) NOT NULL,
  `created` int(10) unsigned NOT NULL default '0',
  `status` enum('Active','Inactive') NOT NULL default 'Active',
  `account_name` varchar(40) NOT NULL,
  `account_full_name` varchar(40) NOT NULL,
  `address` varchar(40) NOT NULL,
  `city` varchar(40) NOT NULL,
  `province` varchar(10) NOT NULL,
  `postcode` varchar(10) NOT NULL,
  UNIQUE KEY `id` (`id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

 --
 -- Dumping data for table `alba2`.`accounts`
 --


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql?unsub...@renefournier.com



 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql?unsub=dstepli...@gmail.com



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=wult...@gmail.com



Re: mysqlimport remote host problem

2009-03-10 Thread Rob Wultsch
On Tue, Mar 10, 2009 at 7:16 PM, René Fournier m...@renefournier.com wrote:

 OK, I've managed to do the same thing with just the mysql command line
 program:

mysql -h 192.168.0.224 -u root -p alba2 
 /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql

 Works great. However, the sql file is normally gzipped, so Can I ungzip
 the file on the fly (and without removing the .gzip version) and pipe the
 contents as I did above? (Yes, I'm UNIX-impaired.)  Something like:

mysql -h 192.168.0.224 -u root -p alba2  gzip -dc
 /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz

 But so that it works...

 ...Rene


Pipe is your friend. You probably want something like:

gzip -dc /Backup/Latest/alba2_2009-03-10_00h45m.Tuesday.sql.gz
| mysql -h 192.168.0.224 -u root -p alba2