UTF8 characters not showing correctly in Wordpress - mysql

I am running out of ideas - Wordpress is refusing to save UTF-8 encoded characters correctly:
http://www.letosanezkou.com/
you can see that when I edit the post content directly in the MySQl DB it works correctly. I have verified the mysql db:
mysql Ver 14.14 Distrib 5.5.24, for Linux (i686) using readline 5.1
Connection id: 2120
Current database: leto_wp1
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.24-cll MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
and my wp-config has the default UTF-8 lines:
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
When I try to update the post, that was edited in phpmyadmin it will save the post incorrectly.
Any ideas on how to fix this please?

Related

FreeTDS UTF-8 insert in mysql

I have a linux server with mysql with symfony framework installed.
Now i'm trying to get data from sql server 2012 and all works great except when i try to insert value in mysql database.
SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\x80 IN P...' for column 'note_anagrafica' at row 1
Seems that the problem is on data conversion.
The data type of column inside mysql where i'm trying to insert the data is:
text
And the collation is:
utf8_unicode_ci
FreeTds configuration is set on UTF-8 and driver is odbc.
Someone have a solution for this problem?
EDIT:
odbc.ini
[server]
Driver = FreeTDS
Server = x.x.x.x
Port = 1234
Database = databasename
TDS_Version = 8
client charseg = UTF-8
server charset = CP1252
freetds.conf
[server]
host = x.x.x.x
port = 1234
tds version = 8.0
client charset = UFT-8
text size = 20971520
use uft-16 = true
doctrine config for mysql.
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
doctrine config for external mssql database:
server:
driver_class: Lsw\DoctrinePdoDblib\Doctrine\DBAL\Driver\PDODblib\Driver
host: "%a_database_host%"
port: "%a_database_port%"
dbname: "%a_database_name%"
user: "%a_database_user%"
password: "%a_database_password%"
charset: utf8mb4
from now i'm getting error when i'm trying to insert data to mysql comes from sql server 2012 with doctrine.
Till now i have no problem on reading execpt that if i out the result on the web the special charaters like ø comes with � symbol.
There is a conversion that i have to made before call
$entityManager->persist($object);
$entityManager->flush();
Set the charset to utf8mb4 for doctrine config and will do the trick.

mysql change default character set latin1 to utf8

I have PHP 5.5.9 and MySQL 5.5.43 Innodb. This is in Kubuntu LTS /etc/mysql/my.cnf
printf("Current character set: %s\n", mysqli_character_set_name($conn));
Current character set: latin1
I've tried
default-character-set = utf8
first but then my mysql server didn't restart
Then I've tried
character-set-server = utf8
then my mysql shell didn't start
How can I rescue this issue? I've managed with
init_connect = 'SET NAMES utf8'
solve the problem for nonroot users, but the charset remains the same (it only displays as nonprivileged users UTF8, it is still Latin1).
And if (a big if) smnd could tell me WHERE should I use utf8mb4? Also in my.cnf file? I had my tables in utf8 and have migrated those with which I am working to utf8mb4 ...
Another Q: IS that applicable for Linux (Kubuntu) server:
https://www.youtube.com/watch?v=3M1Wpw4uOoM
Please help me, thanks, Gregor from lilaum.com
mysqli_set_charset('utf8').
init_connect is ignored for root connections.
utf8mb4 is effectively a superset of utf8. It is needed for Chinese and the new emoji, plus a scattering of obscure character sets.
PHP manual says:
MySQLnd always assumes the server default charset. This charset is sent during connection hand-shake/authentication, which mysqlnd will use.
MySQLnd is the MySQL native driver included with PHP 5.4 and above.
Unfortunately, I have to confirm that even in my system (PHP 5.6.17 with MySQL 5.5.47 on Debian Jessie 8.3) despite having configured /etc/mysql/my.cnf with the following entries
[mysqld]
character-set-server=utf8
[mysql]
default-character-set=utf8
the mysqlnd does not seem to assume the server default charset (utf8) but sets the connection charset to latin1 with collate latin1_swedish (maybe a default value considering MySQL AB was a swedish company).
So, it seems that there's no permanent way to set utf8 charset when connecting from a PHP application. You have to call
$mysqli->set_charset("utf8")
after each connection. This could be embedded in a custom 'dbconnect' PHP function in order to provide a sort of abstraction layer.

foreign character è is not saving in mysql

the name "Eugène" became "EugÃ?ne". Please, give me a solution. I tried before by changing db character set but, still not working.
Connection id: 2939
Current database: clcdb_final
Current user: root#localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.32-log MySQL Community Server (GPL) by Remi
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 45 min 59 sec
and table info: ENGINE=MyISAM AUTO_INCREMENT=57431 DEFAULT CHARSET=latin1
Just check mySql connector jar version. if you using back dated jar then this can be happen.
Verify that you have specified
"charset=utf8"
in your connection string.
As noted in Character Sets and Collations in General
MySQL can do:
Store strings using a variety of character sets
Compare strings using a variety of collations
Mix strings with different character sets or collations in the same server, the same database, or even the same table
Allow specification of character set and collation at any level
Verify that:
"charset=utf8"
And
Collation ==> utf8 - utf8_bin

How to get mysql server info using command line?

Is there a direct command line command that provides all mysql server information like below...This is provided using Mysql GUI administrator. Do we have some direct command to get this info ussing command line ?
Username:
Hostname:
Port:
Server Information
MySQL Version:
Network Name:
IP:
Client Information
Version:
Network name:
IP:
Operating System:
Hardware:
Look at following MySQL documentation:
SHOW VARIABLES
Following command will show you most of your desired information:
SHOW VARIABLES;
Only version:
select version();
EDIT:
What is the difference between show variables and show status?
SHOW STATUS provides server status information like Connections, Opened_tables, Bytes_received, Bytes_sent, etc.
More Info
SHOW VARIABLES shows the values of MySQL system variables like time_zone, version, max_connections, etc.
More Info
Try just status:
mysql> status
--------------
mysql Ver 14.14 Distrib 5.5.33, for osx10.7 (i386) using readline 5.1
Connection id: 3
Current database: somedb
Current user: someuser#localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.33 Source distribution
Protocol version: 10
Connection: 127.0.0.1 via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 38 min 53 sec
Threads: 2 Questions: 196 Slow queries: 0 Opens: 87 Flush tables: 1 Open tables: 80 Queries per second avg: 0.084
--------------

data porting in mysql

While porting data from one mysql database to another there have come some issues like appostrophes have been converted into †in a field called story. Why did this happen and what should I do now to correct the new database?
I have only the phpmyadmin access of the two databases.
Take a look at the charatersets used by your database. You can do this by entering \s in the MySQL client. Example output is:
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
What charactersets do you get and what do you expect?