Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #31302 > unrolled thread
| Started by | রুদ্র ব্যাণার্জী <bnrj.rudra@gmail.com> |
|---|---|
| First post | 2012-10-15 14:45 +0100 |
| Last post | 2012-10-15 15:44 -0400 |
| Articles | 7 — 5 participants |
Back to article view | Back to comp.lang.python
MySQL with Python রুদ্র ব্যাণার্জী <bnrj.rudra@gmail.com> - 2012-10-15 14:45 +0100
Re: MySQL with Python Chris Angelico <rosuav@gmail.com> - 2012-10-16 01:01 +1100
Re: MySQL with Python রুদ্র ব্যাণার্জী <bnrj.rudra@gmail.com> - 2012-10-15 15:47 +0100
Re: MySQL with Python Chris Angelico <rosuav@gmail.com> - 2012-10-16 01:54 +1100
Re: MySQL with Python Demian Brecht <demianbrecht@gmail.com> - 2012-10-15 07:05 -0700
Re: MySQL with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-15 15:20 -0400
Re: MySQL with Python Roy Smith <roy@panix.com> - 2012-10-15 15:44 -0400
| From | রুদ্র ব্যাণার্জী <bnrj.rudra@gmail.com> |
|---|---|
| Date | 2012-10-15 14:45 +0100 |
| Subject | MySQL with Python |
| Message-ID | <1350308732.2373.8.camel@roddur> |
Dear friends, I am starting a project of creating a database using mySQL(my first project with database). I went to my institute library and find that, all books are managing "mySQL with perl and php" I am new to python itself and gradually loving it. I mostly use it as an alternative of shell-script. Since learning a new language for every new project is not possible(its self assigned project, generally in free time), can I do a "mySQL with python?" if yes, can you kindly suggest a book/reference on this?
[toc] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-10-16 01:01 +1100 |
| Message-ID | <mailman.2207.1350309721.27098.python-list@python.org> |
| In reply to | #31302 |
On Tue, Oct 16, 2012 at 12:45 AM, রুদ্র ব্যাণার্জী <bnrj.rudra@gmail.com> wrote: > Dear friends, > I am starting a project of creating a database using mySQL(my first > project with database). > I went to my institute library and find that, all books are managing > "mySQL with perl and php" > > I am new to python itself and gradually loving it. I mostly use it as an > alternative of shell-script. Since learning a new language for every new > project is not possible(its self assigned project, generally in free > time), can I do a "mySQL with python?" > > if yes, can you kindly suggest a book/reference on this? It's definitely possible. As far as I know, though, there's no inbuilt support, so you'll need an add-on module. What platform are you running on? On Debian Linux, for instance, you can simply "apt-get install python-mysqldb". But you may wish to consider using PostgreSQL instead. It's a generally better database engine than MySQL, and is equally well supported: http://wiki.python.org/moin/PostgreSQL Actually, to be quite honest, I'm surprised there's no module in the Python stdlib for either of the above. Possibly because there are several competing options. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | রুদ্র ব্যাণার্জী <bnrj.rudra@gmail.com> |
|---|---|
| Date | 2012-10-15 15:47 +0100 |
| Message-ID | <1350312465.1928.4.camel@roddur> |
| In reply to | #31305 |
On Tue, 2012-10-16 at 01:01 +1100, Chris Angelico wrote: > But you may wish to consider using PostgreSQL instead. Thanks, as I am very much new in database thing, I am not very aware of the options I have. But in my library, I did not found any thing on PostgreSQL. Though, I will google its support as well, can you kindly let me know if this is well documented. I can see there mailing list is quite active. So that may not be a problem though.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-10-16 01:54 +1100 |
| Message-ID | <mailman.2212.1350312875.27098.python-list@python.org> |
| In reply to | #31310 |
On Tue, Oct 16, 2012 at 1:47 AM, রুদ্র ব্যাণার্জী <bnrj.rudra@gmail.com> wrote: > On Tue, 2012-10-16 at 01:01 +1100, Chris Angelico wrote: >> But you may wish to consider using PostgreSQL instead. > Thanks, as I am very much new in database thing, I am not very aware of > the options I have. > But in my library, I did not found any thing on PostgreSQL. > Though, I will google its support as well, can you kindly let me know if > this is well documented. I can see there mailing list is quite active. > So that may not be a problem though. Postgres itself: http://www.postgresql.org/ I posted a link to some Python-PGSQL libraries in my previous post. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Demian Brecht <demianbrecht@gmail.com> |
|---|---|
| Date | 2012-10-15 07:05 -0700 |
| Message-ID | <mailman.2209.1350309918.27098.python-list@python.org> |
| In reply to | #31302 |
On 12-10-15 06:45 AM, রুদ্র ব্যাণার্জী wrote: > if yes, can you kindly suggest a book/reference on this? > There are a few different ways to connect to MySQL, two of which are: For reference on connecting and querying MySQL through mysql-python, take a read through http://mysql-python.sourceforge.net/MySQLdb.html. Another solution is to use SQLAlchemy (http://www.sqlalchemy.org/). The ORM abstracts a lot of the tedious SQL queries out for you and allows you to concentrate more on your application's logic. -- Demian Brecht @demianbrecht http://demianbrecht.github.com
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2012-10-15 15:20 -0400 |
| Message-ID | <mailman.2233.1350328857.27098.python-list@python.org> |
| In reply to | #31302 |
On Mon, 15 Oct 2012 14:45:32 +0100, ????? ??????????
<bnrj.rudra@gmail.com> declaimed the following in
gmane.comp.python.general:
> Dear friends,
> I am starting a project of creating a database using mySQL(my first
> project with database).
> I went to my institute library and find that, all books are managing
> "mySQL with perl and php"
>
> I am new to python itself and gradually loving it. I mostly use it as an
> alternative of shell-script. Since learning a new language for every new
> project is not possible(its self assigned project, generally in free
> time), can I do a "mySQL with python?"
>
> if yes, can you kindly suggest a book/reference on this?
First off, how much "managing" do you expect to perform? For
actually managing the MySQL server you're probably better off
downloading the dedicated application (Used to be "MySQL Admin" and a
separate "MySQL QueryBrowser" -- the current download is a unified
"MySQL Workbench").
For routine database /access/ (that is, someone has created the
database user account that will be used), MySQLdb is the Python adapter
to connect to the server. For using THAT, you basically need to know SQL
(MySQL's flavor in particular), along with understanding the DB-API 2
specification (PEP-249) with the MySQLdb documentation (which explains
any limitations or specifics; see http://mysql-python.sourceforge.net/ )
For books, though some are rather old by now:
MySQL for Python
(Albert Lukaszewski; 2010 Packt Publishing)
The Definitive Guide to MySQL 5 3rd Ed
(Michael Kofler; 2005 Apress)[no Python chapter, but does introduce the
now-discontinued Admin and QueryBrowser applications, and introduces the
features of MySQL v5
Managing & Using MySQL 2nd Ed (Reese/Yarger/King; 2002 O'Reilly)[has 5
pages on MySQL with Python]
And a new edition NOT YET RELEASED -- don't know if this edition
includes anything on Python, the 3rd edition does not; but the volume is
huge and may be close to covering what the old MySQL AB "Administrators
Guide" and "Language Reference" books covered.
MySQL 5th Ed
(Paul DuBois; Dec 2012 Addison-Wesley [Developer's Library])
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
[toc] | [prev] | [next] | [standalone]
| From | Roy Smith <roy@panix.com> |
|---|---|
| Date | 2012-10-15 15:44 -0400 |
| Message-ID | <roy-7BB219.15443915102012@news.panix.com> |
| In reply to | #31336 |
In article <mailman.2233.1350328857.27098.python-list@python.org>, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote: > For routine database /access/ (that is, someone has created the > database user account that will be used), MySQLdb is the Python adapter > to connect to the server. For using THAT, you basically need to know SQL > (MySQL's flavor in particular), along with understanding the DB-API 2 > specification (PEP-249) with the MySQLdb documentation (which explains > any limitations or specifics; see http://mysql-python.sourceforge.net/ ) Another possibility is to use some sort of ORM (Object Relational Mapper), which provides an abstraction layer on top of the raw SQL layer. Two examples are SQLAlchemy (http://www.sqlalchemy.org/) and Django (https://www.djangoproject.com/). A thread on Stack Overflow (http://stackoverflow.com/questions/53428) mentions some additional Python ORMs you might want to explore.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web