473,837 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1516
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
9542
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 the google and it seems I have to build in multibyte support for php and mysql. Mbstring (http://us3.php.net/mbstring) claims to support multiple languages with a caution saying it might not work properly. After further research it seems unicode...
1
3386
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 uses his own php shopping cart to receive customer orders. The configuration was done via cPanel with no external modifications - which produced no protests when built, ran and connected with no
0
1901
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 server following command: CREATE DATABASE dbname DEFAULT CHARACTER SET latin5 COLLATE
1
4861
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 wondering if anybody has experienced the same issues
1
15401
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, lastname, from associates where username like 'nancianne' but now fails with: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from associates
1
5292
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 #./configure it goes through all of the preparing tables and starting mysqlServer and daemon, but than immediaetly says "mysql ended" -- I try to do #make right after anyway, but I get the error "No targets specified and no makefile found" -- Any...
1
5879
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 ? main() File "wa.py", line 257, in main curHandler.walkData()
5
1806
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 upgrade. The source server has MySql 4.1.22. On the source server a string with an apostrophe that was written to the database displays properly. Porting those data to the destination site, and using the same code, produces strange results. For...
39
5886
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 ISO-8859-1 -t UTF-8 mydb.sql mydb_utf8.sql mysqlCREATE DATABASE mydb_utf8 CHARACTER SET utf8 COLLATE utf8_general_ci;
3
3036
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 "C:\Python24\Lib\site-packages\MySQLdb\__init__.py", line 74, in Connect return Connection(*args, **kwargs) File "C:\Python24\lib\site-packages\MySQLdb\connections.py", line 198, in __init__ self.set_character_set(charset) File...
0
9843
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10875
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10566
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10623
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10272
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5669
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5848
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3124
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.