sudo apt-get install python3-mysql.connector или pip3 install mysql-connector
это установит mysql.connector для python3 на ubuntu