Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44844

Re: python backup script

Newsgroups comp.lang.python
Date 2013-05-06 12:20 -0700
References <b586db98-78b2-40a6-9e1c-3d8b939657c8@googlegroups.com> <mailman.1371.1367867496.3114.python-list@python.org>
Message-ID <51f5c8c4-b40b-4a1e-b72b-905caa62aaf6@googlegroups.com> (permalink)
Subject Re: python backup script
From MMZ <programmer.toronto@gmail.com>

Show all headers | View raw


On Monday, May 6, 2013 3:11:33 PM UTC-4, Jerry Hill wrote:
> On Mon, May 6, 2013 at 3:01 PM, MMZ <programme...@gmail.com> wrote:
> 
> 
> 
> I am trying to backup database on CentOS linux server,I'm getting error when running the following script. anyone can help?
> 
> 
> 
> 
> Traceback (most recent call last):
> 
>   File "./backup.py", line 8, in ?
> 
>     username = config.get('client', 'mmz')
> 
>   File "/usr/lib/python2.4/ConfigParser.py", line 511, in get
> 
>     raise NoSectionError(section)
> 
> 
> 
> I've never used ConfigParser, but that  
> 
> error message looks pretty simple to interpret.  You've set up a ConfigParser object, told it to read in ~/my.cnf, the asked for the value of section 'client', option 'mmz'.  The error indicates that your config files doesn't have a section named 'client'.
> 
> 
> 
> What is the content of your ~/my.cnf file?
> 
> -- 
> 
> 
> Jerry

Thank you for helping Jerry. Actually I found this script for debian but I want to use it for CentOS server so I replaced /etc/mysql/debian.cnf with ~/my.cnf
the file content is:

 Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 12:01 -0700
  Re: python backup script Jerry Hill <malaclypse2@gmail.com> - 2013-05-06 15:11 -0400
    Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 12:20 -0700
      Re: python backup script Matt Jones <matt.walker.jones@gmail.com> - 2013-05-06 14:46 -0500
        Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 13:37 -0700
          Re: python backup script Matt Jones <matt.walker.jones@gmail.com> - 2013-05-06 16:08 -0500
  Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-06 23:44 +0200
    Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-06 23:48 +0200
      Re: python backup script mina@socialassets.org - 2013-05-06 15:12 -0700
        Re: python backup script John Gordon <gordon@panix.com> - 2013-05-06 22:15 +0000
          Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-07 21:11 +0200
        Re: python backup script MRAB <python@mrabarnett.plus.com> - 2013-05-06 23:28 +0100
      Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 15:15 -0700
  Re: python backup script Chris Angelico <rosuav@gmail.com> - 2013-05-07 08:12 +1000
    Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 15:40 -0700
      Re: python backup script Chris Angelico <rosuav@gmail.com> - 2013-05-07 08:51 +1000
      Re: python backup script MRAB <python@mrabarnett.plus.com> - 2013-05-06 23:52 +0100
  Re: python backup script Peter Otten <__peter__@web.de> - 2013-05-07 08:18 +0200

csiph-web