init-connect = 'SET NAMES utf8 COLLATE utf8_general_ci'
Citation
Stephsteph
Pour les suggestions de Artemus23, ...
mysql> SHOW VARIABLES LIKE 'char%'; +--------------------------+-----------------------------------------------+ | Variable_name | Value | +--------------------------+-----------------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | latin1 | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | f:\Wamp\bin\mysql\mysql8.0.22\share\charsets\ | +--------------------------+-----------------------------------------------+ 8 rows in set (0.01 sec) mysql>
Citation
Stephsteph
Est-ce important ?
Citation
Stephsteph
Pour les suggestions de Artemus23, je suis trop newbie pour savoir comment adapter.
[client] # --------------- # # Charset # # --------------- # default-character-set = utf8
[mysqld] # --------------- # # Charset # # --------------- # character-set-server = utf8 collation-server = utf8_general_ci character-set-filesystem = utf8 init-connect = 'SET NAMES utf8 COLLATE utf8_general_ci' # ------------------------------ # # Load data local infile # # ------------------------------ # local-infile = 1 secure-file-priv = E:/30.MySql loose-local-infile = on
Citation
Stephsteph
Pour le fichier ".csv" à charger :
Citation
Stephsteph
S'agit il de créer un fichier .csv rempli seulement avec ses 3 lignes puis de faire un load data infile avec ce fichier???
Citation
Stephsteph
Une dernière remarque, dans ma table j'ai dans la bdd de Juin comme dans la nouvelle, pour localitiesbase (et les autres tables) interclassement utf8_general_ci, et non DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_ci` comme l'indique Artemus23
SHOW CHARACTER SET;
# ********************* # # # # Sphere "Bleu" # # # # ********************* # # ==================== # # MySql Client # # ==================== # [client] port = 3306 socket = mysql # ----------------------- # # access features # # ----------------------- # host = localhost user = root password = toor # --------------- # # Charset # # --------------- # default-character-set = latin1 # ==================== # # MySql Server # # ==================== # [mysqld] port = 3306 socket = mysql # ---------------------- # # Master & Slave # # ---------------------- # server-id = 1 skip-slave-start # ---------------# # Buffer # # ---------------# join-buffer-size = 512M read-buffer-size = 512M read-rnd-buffer-size = 512M sort-buffer-size = 512M # --------------- # # Charset # # --------------- # character-set-server = latin1 collation-server = latin1_general_ci character-set-filesystem = latin1 init-connect = 'SET NAMES latin1 COLLATE latin1_general_ci' # ------------------- # # Date & Time # # ------------------- # default-time-zone = SYSTEM explicit-defaults-for-timestamp = on # ------------------- # # Directories # # ------------------- # basedir = f:/Wamp/bin/mysql/mysql8.0.22/ datadir = f:/Wamp/bin/mysql/mysql8.0.22/data tmpdir = f:/Wamp/tmp # -------------------# # Encryption # # -------------------# early-plugin-load = keyring_file.dll keyring-file-data=f:/Wamp/keyring/keyring # -------------------------# # Full Text Search # # -------------------------# ft-max-word-len = 10 ft-min-word-len = 1 ft-stopword-file = "" # ---------------# # InnoDB # # ---------------# default-storage-engine = InnoDB default-tmp-storage-engine = InnoDB innodb-adaptive-hash-index = on innodb-buffer-pool-dump-now = off innodb-buffer-pool-dump-at-shutdown = off innodb-buffer-pool-instances = 2 innodb-buffer-pool-load-at-startup = off innodb-buffer-pool-size = 1G innodb-data-file-path = ibdata1:12M:autoextend:max:500M innodb-data-home-dir = f:/Wamp/bin/mysql/mysql8.0.22/data innodb-default-row-format = compact innodb-doublewrite = on #skip-innodb_doublewrite innodb-file-per-table = 1 innodb-flush-log-at-trx-commit = 1 innodb-flush-method = normal #innodb-force-recovery = 1 innodb-ft-enable-stopword = off innodb-ft-max-token-size = 10 innodb-ft-min-token-size = 0 innodb-io-capacity = 2000 innodb-max-dirty-pages-pct = 90 innodb-lock-wait-timeout = 600 innodb-log-buffer-size = 16M innodb-log-file-size = 20M innodb-log-files-in-group = 2 innodb-log-group-home-dir = f:/Wamp/bin/mysql/mysql8.0.22/data innodb-max-dirty-pages-pct = 80 innodb-optimize-fulltext-only = 1 innodb-page-size = 16K innodb-purge-threads = 10 innodb-read-io-threads = 10 innodb-stats-on-metadata = 0 # innodb-strict-mode = off innodb-thread-concurrency = 16 innodb-undo-log-truncate = on innodb-write-io-threads = 4 # ---------------- # # Language # # ---------------- # lc-messages = fr_FR lc-time-names = fr_FR # ------------------------ # # Load data infile # # ------------------------ # local-infile = 1 secure-file-priv = E:/30.MySql loose-local-infile = on # -------------------# # Binary Log # # -------------------# # binlog-expire-logs-seconds = 0 # expire_logs_day = 0 # log-bin = f:/Wamp/logs/mysql_binary_log # log-bin-index = f:/Wamp/logs/mysql_binary_log.index # binlog-cache-size = 10M # binlog-format = mixed # binlog-do-db = test # sync-binlog = 1 skip-log-bin skip-log-slave-updates # --------------------# # General Log # # --------------------# #general-log = 1 #general-log-file = f:/Wamp/logs/mysql_general.log #log_output = 'FILE'; # ------------# # Log # # ------------# log-error = f:/Wamp/logs/mysql_error.log log-error-verbosity = 3 log-queries-not-using-indexes = 1 log-slow-admin-statements = 1 log-throttle-queries-not-using-indexes = 60 # ------------# # Max # # ------------# max-allowed-packet = 16M max-connections = 20 max-connect-errors = 10 max-error-count = 64 max-heap-table-size = 512M max-user-connections = 0 max-sp-recursion-depth = 255 # ---------------# # MyIsam # # ---------------# bulk-insert-buffer-size = 64M key-buffer-size = 1G myisam-max-sort-file-size = 1G myisam-recover-options = off myisam-repair-threads = 1 myisam-sort-buffer-size = 128M myisam-stats-method = nulls_unequal myisam-use-mmap = off # -------------------# # Networking # # -------------------# back-log = 50 bind-address = 0.0.0.0 net-buffer-length = 8K # -----------------# # Password # # -----------------# default-authentication-plugin = mysql_native_password default-password-lifetime = 0 disconnect-on-expired-password = 0 # ---------------------------# # Performance-Schema # # ---------------------------# # performance-schema = ON # performance-schema-events-waits-history-size = 20 # performance-schema-events-waits-history-long-size = 1500 # --------------# # Query # # --------------# query-alloc-block-size = 8M # -------------# # Skip # # -------------# skip-external-locking skip-federated # skip-mysqlx # skip-grant-tables # skip-innodb-adaptive-hash-index # skip-innodb-doublewrite # skip-log-warnings # skip-networking # skip-ssl # --------------------# # Slow & Long # # --------------------# long-query-time = 0 slow-query-log = 1 slow-query-log-file = f:/Wamp/logs/mysql_slow.log # ------------# # SSL # # ------------# # skip-ssl # ssl-ca = ca.pem # ssl-cert = server-cert.pem # ssl-key = server-key.pem # ssl-cipher = DHE-RSA-AES128-GCM-SHA256 sha256-password-auto-generate-rsa-keys=off caching-sha2-password-auto-generate-rsa-keys=off ssl-ca = f:/Wamp/bin/apache/apache2.4.46/conf/certificat/ca/ca.crt ssl-capath = f:/Wamp/bin/apache/apache2.4.46/conf/certificat/ca/ ssl-cert = f:/Wamp/bin/apache/apache2.4.46/conf/certificat/Artemus/Server/artemus.crt ssl-key = f:/Wamp/bin/apache/apache2.4.46/conf/certificat/Artemus/Server/artemus.key ssl-cipher = DHE-RSA-AES128-GCM-SHA256 # --------------# # Table # # --------------# table-definition-cache = 512 table-open-cache = 512 # -------------------# # Temp Table # # -------------------# tmp-table-size = 1G # ---------------# # Thread # # ---------------# thread-cache-size = 8 thread-stack = 256K # ------------------------------# # Timeout Configuration # # ------------------------------# connect-timeout = 600 interactive-timeout = 600 net-read-timeout = 600 net-write-timeout = 600 wait-timeout = 600 # --------------------# # Transaction # # --------------------# transaction-isolation = SERIALIZABLE # ---------------# # Tuning # # ---------------# concurrent-insert = 2 open-files-limit = 8192 # =================== # # MySql Admin # # =================== # [mysqldadmin] force # ================== # # MySql Dump # # ================== # [mysqldump] add-drop-database add-drop-table add-drop-trigger default-character-set = latin1 flush-logs flush-privileges lock-all-tables max-allowed-packet = 16M no-autocommit order-by-primary quick routines skip-comments skip-opt skip-set-charset skip-tz-utc triggers # ===================== # # My Isam Check # # ===================== # [myisamchk] key-buffer-size = 128M sort-buffer-size = 128M read-buffer = 2M write-buffer = 2M # ====================== # # MySql Hot Copy # # ====================== # [mysqlhotcopy] interactive-timeout # ===================== # # MySql Monitor # # ===================== # [mysql] no-auto-rehash #safe-updates skip-reconnect table # ================== # # MySql Safe # # ================== # [mysqld_safe] open-files-limit = 8192 log-error = f:/Wamp/logs/mysql_error.log log-error-verbosity = 3Ne le reprenez pas tel quel car il est fait pour mon environnement.