473,386 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MySQL character sets

Hello,

I recently upgraded from 4.0 to 4.1. I've spent the last few days
reading up on charsets since I never really thought about it when I used
4.0. I thought I had most of it figured out, but then I saw this in
phpMyAdmin and am as confused as when I started:

MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8-unicode-ci (in a dropdown box)

I know that with 4.1, the default charset for tables is latin1, and the
default collation is latin1_swedish_ci. Why would these default to
latin1, but then my server and connection default to utf-8? I might be
totally off base but I would have thought the default for each would be
the same charset...

Also, is this why queries entered into phpMyAdmin such as:

UPDATE ...
SET ...
WHERE `fieldname` = 'test'

now automatically get converted to:

UPDATE ...
SET ...
WHERE CONVERT( `fieldname` USING utf8 ) = 'test'

From all the online documentation I have been reading, it seems that
ideally I would convert my whole system over to use utf-8... practically
speaking, however, I would rather not, as I really only have the need to
store ASCII characters and after upgrading have altered my data
validation functions to check for ASCII. Given this and what I have
provided above, would it be allright for me to leave everything as is
(defaulted), or do I need to alter anything with any of my charsets?
For example, I have not changed any of my queries to reflect the
phpMyAdmin added syntax above, but everything seems to still work ok.
Dealing with these charsets is still new to me, and I'm not sure what
else I can get out of these tutorials (I currently have 34 firefox
windows open), so I thank you all very much for any help you can provide.

- Marcus
Jun 26 '06 #1
1 1499
Just as a followup, I did some more reading and I think the discrepancy
in charsets is because phpMyAdmin is using utf-8. I ran a status query
in mysql and see that the 4 default charsets are in fact all latin1.

This being the case, how do I check to make sure my php application is
connecting with latin1? I'm not really sure where to check this or how
to set it... I only know that phpMyAdmin has a setting in it's config file.

Please correct me if anything I just typed is wrong. And also, I still
am not sure if the scenario I posted at the end of my initial post
regarding latin1 instead of utf-8 for my tables is ok. Thanks!!!
Jun 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Aditya Ivaturi | last post by:
We have a CMS which is written is based on php & mysql. Recently we received a request to support multiple languages so that sites in that particular laguage can be created. I did some search on...
1
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer...
0
by: newman | last post by:
Dear all, I have mysql 4.1.11 on my current server, i need my database restore another server.. (another server mysql version is 4.1.11 same.) And now... I just created new my database to new...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
1
by: Ike | last post by:
Recently, I began using a different MySQL verver (i.e. different machine as well as different version#, going from 4.12a to 4.1.9 max). The following query used to work: select firstname,...
1
by: PowerLifter1450 | last post by:
I've been having a very rough time installinig mySQL on Linux. I have been following the instructions form here: http://www.hostlibrary.com/installing_apache_mysql_php_on_linux Everytime I get to...
1
by: erikcw | last post by:
Hi, I'm trying to insert some data from an XML file into MySQL. However, while importing one of the files, I got this error: Traceback (most recent call last): File "wa.py", line 304, in ?...
5
by: Shelly | last post by:
I am running into a character problem and I am seeking a little advice. The client is moving his code from one server to another. The destination server has MySQL 4.0.7 and the host will not...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
3
by: marexposed | last post by:
I've got this error (see the path in last line) db=MySQLdb.connect(host='localhost',use_unicode = True, charset = "Windows-1251",user='root',passwd='12',db='articulos') File...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.