Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4618836
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:20:40+00:00 2026-05-22T02:20:40+00:00

Using MySQLdb I connect to a database where everything is stored in the utf8

  • 0

Using MySQLdb I connect to a database where everything is stored in the utf8 encoding.

If I do

cursor.execute("SET NAMES utf8")

and fetch some data from the database by another statement. Does that mean, that the strings in

cursor.execute("SELECT ...")
cursor.fetchall()

will be in unicode? Or do I have to turn them first by

mystr.decode("utf8")

to unicode?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:20:41+00:00Added an answer on May 22, 2026 at 2:20 am

    From the docs:

    connect(parameters…)
    …

    use_unicode

    If True, CHAR and VARCHAR and TEXT columns are returned as Unicode strings, using the configured character set. It is best to set the default encoding in the server configuration, or client configuration (read with read_default_file). If you change the character set after connecting (MySQL-4.1 and later), you’ll need to put the correct character set name in connection.charset.

    If False, text-like columns are returned as normal strings, but you can always write Unicode strings.

    This must be a keyword parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to a MySQL database on a remote server using MySQLdb
I'm using MySQLdb library to connect to MySQL within my Python script. (Ref: http://mysql-python.sourceforge.net/MySQLdb.html
I am using OOP MySQLi to connect to my database. I have checked my
I'm using MySQLdb to upload a lot of data from text files into a
I want to insert data in MYSQL database using python here my code import
Hi everyone in php when you fetch data from a mysql database and echo
Using Robotframework 2.6.3 and the python database library, I want to connect to MySql
I am using Python MySQLDB, and I want to insert this into DATETIME field
I'm using Elixir 0.7.1 , Sqlalchemy 0.6beta1 , MySQLdb 1.2.2. My Model file 'model.py'
I'm deploying my Django app to another host/server using mod_wsgi and MySQLdb. Right now,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.