Muutke küpsiste eelistusi

E-raamat: MySQL Connector/Python Revealed: SQL and NoSQL Data Storage Using MySQL for Python Programmers

  • Formaat: PDF+DRM
  • Ilmumisaeg: 31-Jul-2018
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484236949
  • Formaat - PDF+DRM
  • Hind: 67,91 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: PDF+DRM
  • Ilmumisaeg: 31-Jul-2018
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484236949

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Move data back and forth between database and application. The must-have knowledge in this book helps programmers learn how to use the official driver, MySQL Connector/Python, by which Python programs communicate with the MySQL database. 

This book takes you from the initial installation of the connector through basic query execution, then through more advanced topics, error handing, and troubleshooting. The book covers both the traditional API as well as the new X DevAPI. The X DevAPI is part of MySQL 8.0 and is an API that can be used with connectors for several programming languages and is used from the command-line interface known as MySQL Shell. You will learn to use the connector by working through code examples and following a discussion of how the API calls work. 

By the end of the book, you will be able to use MySQL as the back-end storage for your Python programs, and you’ll even have the option of choosing between SQL and NoSQL interfaces. 

What You'll Learn
  • Install MySQL Connector/Python
  • Connect to MySQL and configure database access
  • Execute SQL and NoSQL queries from your Python program
  • Trap errors and troubleshoot problems
  • Store data from different languages using MySQL’s character set support
  • Work in the X DevAPI that underlies all of MySQL’s language connectors
Who This Book Is For

Developers familiar with Python who are looking at using MySQL as the back-end database. No prior knowledge of Connector/Python is assumed, but readers should be familiar with databases and the Python programming language. 

About the Author xiii
About the Technical Reviewer xv
Acknowledgments xvii
Introduction xix
Part I: Getting Ready 1(44)
Chapter 1 Introduction and Installation
3(42)
Introduction
3(5)
Versions
4(1)
Community and Enterprise Editions
5(1)
APIs
6(2)
Downloading
8(7)
Installation
15(14)
pip - All Platforms
16(4)
Microsoft Windows - MySQL Installer
20(5)
Linux - MySQL Yum Repository
25(2)
Verifying the Installation
27(2)
MySQL Server
29(6)
Installation
29(4)
Configuration
33(2)
Creating the Application User
35(2)
Installing the world Sample Database
37(4)
Code Examples
41(2)
Summary
43(2)
Part II: The Legacy APIs 45(212)
Chapter 2 Connecting to MySQL
47(36)
Creating the Connection from Python
47(11)
Syntax
48(2)
Common Connection Options
50(2)
Connection Examples
52(3)
Reconfiguration and Reconnect
55(2)
Connection Best Practices
57(1)
Configuration Files
58(6)
Alternatives to Hardcoding the Configuration
58(2)
Using MySQL Configuration Files
60(4)
General Configuration
64(18)
Connection
64(7)
Character Set
71(9)
Query Behavior
80(1)
Warnings
81(1)
Summary
82(1)
Chapter 3 Basic Query Execution
83(50)
Simple Execution
83(22)
Executing the Query: cmd_query()
85(4)
Retrieving Rows - get_rows()
89(6)
Automatic Conversion into Native Python Types
95(3)
Retrieving Rows - get_rows() With Limit
98(3)
Retrieving Rows - get_row()
101(3)
Consuming Results
104(1)
Cursors
105(16)
Instantiation
106(3)
MySQLCursor - Execution Flow
109(2)
MySQLCursor - Query Execution
111(4)
MySQLCursor - Properties
115(3)
The Dictionary and Named Tuple Cursor Subclasses
118(3)
Handling User Input
121(10)
Validating the Input
122(1)
Query Parameterization
122(5)
Prepared Statements
127(4)
Summary
131(2)
Chapter 4 Advanced Query Execution
133(90)
Multi-Query Execution
134(17)
Multiple Queries with Support for Results
135(8)
Multiple Queries Based on a Template
143(5)
Extended Inserts
148(3)
Buffered Results
151(5)
Stored Procedures
156(6)
Loading Data Using a CSV File
162(8)
Loading a Server-Side File
163(1)
Loading an Application-Side File
164(1)
Load Data Example
165(5)
Connection Properties
170(5)
Transactions
175(13)
Default Database
188(2)
Time Zones
190(6)
Other Connection Utility Methods
196(10)
Connection Methods
198(6)
Server Information Methods
204(2)
Column Information
206(8)
Field Types
207(2)
MySQL Column Flags
209(5)
The C Extension
214(7)
The mysql.connector.connect() Function
215(3)
The _mysql_connector Module
218(3)
Summary
221(2)
Chapter 5 Connection Pooling and Failover
223(34)
Connection Pooling - Background
223(6)
The pooling.MySQLConnectionPool Class
224(2)
The pooling.PooledMySQLConnection Class
226(1)
Configuration Options
227(2)
Using Connection Pools
229(15)
Creating a Connection Pool
229(2)
Using Connection Pool Connections
231(8)
Executing Queries
239(2)
Reconfiguring the Connections
241(3)
Connection Failover
244(12)
Failover Configuration
245(3)
Coding for Failover
248(2)
Failover Example
250(6)
Summary
256(1)
Part III: The X DevAPI 257(146)
Chapter 6 The X DevAPI
259(46)
The MySQL X Plugin
261(2)
The mysqlx Module
263(4)
Creating a Session
267(8)
Passing Individual Options
268(4)
Passing an URI
272(2)
Connection Examples
274(1)
Working with the Session
275(2)
Transactions
275(1)
Other Session Methods
276(1)
Schemas
277(17)
Schema Manipulation
278(6)
Other Schema Methods and Properties
284(2)
Schema Example
286(3)
CRUD Arguments
289(1)
Documents
289(2)
Document ID
291(1)
Condition
292(1)
Fields
293(1)
Statements
294(4)
Results
298(6)
result.Result
299(1)
result.DocResult and result.RowResult
300(2)
result.SqlResult
302(2)
Summary
304(1)
Chapter 7 The MySQL Document Store
305(66)
The MySQL Document Store
305(2)
Workflow
307(2)
Collections
309(22)
Collection Manipulation
310(20)
Other Collection Methods and Properties
330(1)
Queries - CRUD
331(2)
CRUD: Create
333(6)
CRUD: Read
339(7)
CRUD: Update
346(20)
Replacing Documents
347(3)
Modifying Documents
350(16)
CRUD: Delete
366(4)
Summary
370(1)
Chapter 8 SQL Tables
371(32)
Workflow
371(2)
NoSQL API for SQL Tables
373(20)
Table and View Objects
374(3)
Table Queries
377(1)
CRUD: Create
378(4)
CRUD: Read
382(5)
CRUD: Update
387(3)
CRUD: Delete
390(3)
SQL Statements
393(7)
Executing SQL Statements
394(3)
Queries with Multiple Result Sets
397(3)
Summary
400(3)
Part IV: Error Handling and Troubleshooting 403(102)
Chapter 9 Error Handling
405(48)
Warnings, Errors, and Strict Modes in MySQL Server
406(5)
Treating Note Level Messages as Warnings
406(2)
Strict Modes
408(2)
The MySQL Error Log
410(1)
Warning and Error Handling
411(15)
Configuration
411(4)
Fetching Warnings After cmd_query()
415(6)
Fetching Warnings with Cursors
421(3)
Fetching Warnings with the X DevAPI
424(2)
MySQL Error Numbers and SQL States
426(6)
MySQL Error Numbers
427(2)
SQL States
429(3)
Exception Classes
432(9)
Built-In Classes
433(4)
Mapping Errors to Exception Classes
437(1)
Custom Exceptions
438(3)
Locking Issues
441(3)
What to Do When Things Go Wrong
444(6)
Severity
445(1)
Impact
445(1)
Frequency
446(1)
Retriable
446(4)
Effort
450(1)
Summary
450(3)
Chapter 10 Troubleshooting
453(52)
Troubleshooting Steps
453(17)
Checking Warnings
454(1)
Determining the SQL Statement
455(7)
Retrieving Raw Data
462(1)
Reading the MySQL Connector/Python Source Code
463(1)
Changing the Implementation
464(1)
MySQL Server Logs
464(6)
Tools for Debugging
470(17)
MySQL Shell
470(8)
PyCharm
478(9)
Troubleshooting Examples
487(16)
Unread Result Found
487(3)
Data Too Long or Out of Range Value
490(3)
Data Changes Are Lost
493(2)
The Used Command Is Not Allowed with This MySQL Version
495(1)
Bulk Changes Causes Corruption or Errors
496(1)
Unsupported Argument When Creating the Connection
497(1)
Aborted Connections in the MySQL Server Error Log
498(1)
Locking Issues
499(4)
Summary
503(2)
Index 505
Jesper Wisborg Krogh is a member of the Oracle MySQL Support team and has spoken on several occasions at Oracle OpenWorld. He has a Ph.D. in computational chemistry before changing to work with MySQL and other software development in 2006. Jesper lives in Sydney, Australia, and enjoys spending time outdoors walking, traveling, and reading. His areas of expertise include MySQL Cluster, MySQL Enterprise Backup, and the Performance and sys schemas. He is an active author in the Oracle Knowledge Base, and regularly blogs on MySQL topics.