Python Forum
MySQL not accepting utf8mb4. Warning 3719
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySQL not accepting utf8mb4. Warning 3719
#1
Hi,

I'm connecting to my MySQL 8 database OK but it issues me with a warning when I run my python script:

Warning: (3719, "'utf8' is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.")
cursor.execute(statement, parameters)


not sure why it thinks it's UTF8? Anyhow, after searching on Google, I created a test database with 1 table that is defined as such:

CREATE SCHEMA cicd_loadrunner DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

CREATE TABLE cicd_loadrunner.lr_testname (
id INT NOT NULL AUTO_INCREMENT,
test_name VARCHAR(255) CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci NOT NULL,
deleted VARCHAR(1) CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (id))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;


Python:
engine = create_engine('mysql+mysqldb://root:mysqltest@localhost/cicd_loadrunner')
connection = engine.connect()

print (engine.table_names())
So not sure what I'm doing wrong here? Do I need to do anything else on the Python side that I'm missing? Or is it in purely in the database?

PS. Hit send too quickly :) I double checked and utf8mb4 is a valid type for MySQL 8; I'm using python libs sqlalchemy and mysqlclient.

Cheers,
J
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mysql and mysql.connector error lostintime 2 664 Oct-03-2023, 10:25 PM
Last Post: lostintime
  Mysql error message: Lost connection to MySQL server during query tomtom 6 15,993 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  Accepting inputs str vs int lbtdne 2 1,812 May-14-2020, 01:45 PM
Last Post: lbtdne
  Problem with accepting multiple string inputs Ryan_Todd 5 2,932 Jan-22-2020, 06:12 PM
Last Post: buran
  signal.itimer() not accepting keyword arguments Skaperen 2 2,238 Dec-19-2019, 12:14 AM
Last Post: Skaperen
  Accepting strings as arguments when slicing a string? (Ziyad Yehia on Udemy) Drone4four 4 3,782 Aug-23-2019, 07:59 PM
Last Post: Drone4four
  Sqlalchemy accepting ISO 8601 KirkmanJ 0 3,574 Jul-27-2018, 01:52 PM
Last Post: KirkmanJ
  if loop is not accepting && A_Embedded 2 2,736 Apr-22-2018, 02:24 PM
Last Post: A_Embedded
  Warning password insecure - Mysql backup with Python HyiikO 4 5,115 Jun-09-2017, 12:49 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020