Python ile MYSQL den veri sorgulatmak
[code]""" Python to MySQL using mysql-python from Sourceforge
at http://prdownloads.sourceforge.net/mysql-python
This is a very simple demonstration of the Python to
MySQL interface downloaded and installed from the above
address.
If you have a database and table already set up for test
purposes, you should be able to adopt this code to work.
"""
import _mysql
db=_mysql.connect(host="192.168.200.66",user="trainee",
passwd="abc123",db="forsale")
db.query("""SELECT agent, street, town, phone FROM agents""")
r = db.store_result()
while 1:
row = r.fetch_row()
if not row: break
print row
note = """
Note - issues that may arise:
1. MySQL version dependencies and supported versions.
See distribution for full details but you may need to
export mysqlclient=mysqlclient
if you don't have the threadsafe libraries.
2. If you have older libraries / newer MySQL, you may
need to set old_password - see link from
http://www.wellho.net/mouth/515_MySQL-an-FAQ.html
3. You need the Python development environment installed
in order to load the MySQL / Python drivers.
4. store_result pulls back the whole result set internally
and you may prefer to call up use_result instead
"""[/code]
at http://prdownloads.sourceforge.net/mysql-python
This is a very simple demonstration of the Python to
MySQL interface downloaded and installed from the above
address.
If you have a database and table already set up for test
purposes, you should be able to adopt this code to work.
"""
import _mysql
db=_mysql.connect(host="192.168.200.66",user="trainee",
passwd="abc123",db="forsale")
db.query("""SELECT agent, street, town, phone FROM agents""")
r = db.store_result()
while 1:
row = r.fetch_row()
if not row: break
print row
note = """
Note - issues that may arise:
1. MySQL version dependencies and supported versions.
See distribution for full details but you may need to
export mysqlclient=mysqlclient
if you don't have the threadsafe libraries.
2. If you have older libraries / newer MySQL, you may
need to set old_password - see link from
http://www.wellho.net/mouth/515_MySQL-an-FAQ.html
3. You need the Python development environment installed
in order to load the MySQL / Python drivers.
4. store_result pulls back the whole result set internally
and you may prefer to call up use_result instead
"""[/code]
Konular
- PHP Nedir?
- PHP′de değişken nasıl oluşturulur ve nasıl kullanılır?
- Direct Admin demo
- Direct Admin türkçe destek
- subtok : kelimelerde istedigin yerden kesip alabilme kolaylığı
- DirectAdmin Kurulumu
- Curl nedir? nasıl kullanılır?
- Raid nedir? Linux Software Raid Nasıl Yapılır?
- Directadmin Root /Admin Mysql Erişimi
- Google Ping Fonksiyonu {PHP}
- Latin1 database’i utf-8 e convert etme
- Linux icin top 20 http baglantisini gormek ve iptables ile bloklamak
- Makro çekimler için objektif seçenekleri
- Ekipman siteleri
- Web sitenden para kazanma tıklama başı 12 krş
- Mikrostok Fotoğraf Siteleri
- Websiteniz için mobil uygulama istemez misiniz?
- İstanbulda Burun Estetiği
- İSLAMİ DÜĞÜNLER - DİNİ DÜĞÜN ORGANİZASYONLARI
- ilahi grupları
- wordpress otomatik yorum gönderme programı
- Site Tanıtımı İzinli Forumlar (Yeni Arşiv)
- RO2 İle Günde 3$ Kazanın! (Ödeme Kanıtıyla Birlikte)
- www.avcajans.com Yeni Nesil Haber Sitesi !
- Curl Nedir ? Fonksiyonları Nelerdir ?
- Duolingo seviyeleri
- Semrush ve ahrefs
- Server responded algorithm negotiation failed hatası
- Populer 15 tane linux işletim sistemi
- Linux un mucidi Linus Torvalds kimdir?