Not able to input arabic data in phpmyadmin - mysql

I am trying to add Arabic values in database . When I enter it in database it shows error
Warning: #1366 Incorrect string value: '\xD8\xA7\xD9\x84\xD9\x85...' for column 'a_name' at row 1" error
My phpmyadmin server info is
Server: 127.0.0.1 via TCP/IP
Server type: MySQL
Server version: 5.6.14 - MySQL Community Server (GPL)
Protocol version: 10
User: root#localhost
Server charset: UTF-8 Unicode (utf8)

For inserting Arabic text follow these steps
1) Go to that table structure
2) Click on change [Where you want to add the Arabic text]
3) Search for "Collation" and select "utf8_unicide_ci"
In this way you will be able to add the Arabic Inputs in database
Happy Coding
Cheers !!!!!

Related

Column value changes automatically in MySQL

I'm trying to import excel file using maatwebsite/excel in Laravel. It's working fine with short number like 1234 of column value. But when I try to import with long number like 123456789 this the column value changed automatically with a random number. I have dd($row['my_column_name']); that output exact value that I put in Excel file; My database column data type varchar(255).
Note: Only problem in Live server (Shared Hosting)
Live Server MariaDB Info:
Server: Localhost via UNIX socket
Server type: MariaDB
Server version: 10.3.28-MariaDB-log-cll-lve - MariaDB Server
Localhost MySQL Info:
Server: localhost via TCP/IP
Server type: MySQL
Server version: 5.7.24 - MySQL Community Server (GPL)

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.

Unknown character set utf8mb4

I'm developing my PHP apps on XAMMP on a usb stick, the character set is utf8_unicode_ci, when I exported the db and imported the SQL into my live server at OVH, it gave me this error:
1115 - Unknown character set: 'utf8mb4'
My XAMMP dev server DB version:
Server type: MariaDB
Server version: 10.1.13-MariaDB - mariadb.org binary distribution
My OVH live server version:
Server type: MySQL
Server version: 5.1.73 - Source distribution
No how to solve this? Thanks.
use my sql server 5.5.3 or newer, or replace all 'utf8mb4' to 'utf8' in your DB dump

Unknown character set: 'utf8mb4'

I know that many had this problem, and solved it, but even with their solutions, I've gotten no luck..
I tried exporting my localhost phpadmin to my webserver, and i got:
SQL query:
/*!40101 SET NAMES utf8mb4 */;
MySQL said: Documentation
#1115 - Unknown character set: 'utf8mb4'
Local phpmyadmin:
Server type: MariaDB
Server charset: UTF-8 Unicode (utf8)
Version: 4.5.2
Webhost phpmyadmin:
Version: 2.11.4
Solved it. Downloaded MYSQL workbench, logged into my local database, and exported it from the program. Then, i simply imported the file, and it worked!

How to downgrade the phpadmin in XAMPP

I am trying to connect to remote database server with phpadmin on my home system. My Server uses Mysql version 5.1.61 and this mysql version is very old for the new xampp phpadmin version. I am thinking to downgrade the phpadmin version in xammpp 5.6.8
But I am getting an error due to compatibility error.
Error:
SQL query: Edit Edit
SET CHARACTER SET 'utf8mb4';
MySQL said: Documentation
1115 - Unknown character set: 'utf8mb4'
"utf8mb4" is an extended character set used in Mysql 5.5.3 and higher. Try converting the DB to use utf8 only instead of utf8mb4.
Below URL might help.
http://ben.lobaugh.net/blog/201740/script-to-convert-mysql-collation-from-utf8mb4-to-utf8