Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Default Charset/collation In Mysql


My language is Farsi and since I was using previous versions of MySQL, I had no problem. But upgrading to 4.1, I notice that character "Ý" is not displayed the way it should be. After reading chapter 10 of mysql manual, I sent this query after connecting to my database in PHP, and I have no problem:


$res = mysql_query("SET NAMES 'utf8'");
if ( !$res )
{
print "<pre>" . mysql_error() . "</pre>";
}


The thing is that I really do not wana send it in my PHP code, since I have some scritps that I'm not allowed to modify, so, I tried starting mysqld with the default-character-set option, just like:


mysqld_safe --default-character-set=utf8 --default-collation=utf8_general_ci &


and it really works fine. I even checked the Server Variable and Settings in phpMyAdmin and everything is set to utf8. But you know what? My code still doesn't work if I remove the first code that I wrote in here, I mean if I don't send that query (SET NAMES 'utf8'), I was wondering why? I mean it's working, as the server variables show, but then they have no effect. What should I do.




View Complete Forum Thread with Replies

Related Forum Messages:
How To Change The Default Charset With GBK Or Other Language Of Mysql ??
I install a mysql server in default installation with latin charset, but I want to use GBK(a chinese charset), so that I can store and search chinese words directly. Code:

View Replies !
CREATE TABLE With DEFAULT CHARSET In MySQL &lt; 4.1
Ok, I've read the whole chapter 10 of the reference manual and now I know, that only MySQL Version up from 4.1 support the

CREATE TABLE tbl (cols) DEFAULT CHARACTER SET foo COLLATE bar

statement. But is it possible to create tables with special charactersets (at least UTF8) with a MySQL version prior to 4.1?

View Replies !
French Collation And Charset
I read the online manual to find how to change teh collation and charset wich I am now able to do. The only thing, is that I can't find one that support "é", "ô" and others like that.

Any1 know what is the good charset, collation mix for that?

View Replies !
Messed Up Charset & Collation
have made a bit of a mess of our database. Without learning anywhere near enough about the implication of changing the website charset and database collation I made a few tweeks. Now we have strange characters as a result and I think database contents that are neither one collation or another as its now a bit of a mix.

I'm looking to have everything as UTF-8 but am now realising that there may be quite a lot of data that need tidying up as a result. Our database if currently latin1_swedish_ci and our website is UTF-8,

View Replies !
Remove Feature Of Default Charset?
I really don't want to use this irritating feature at all. Is there a way to remove completely. Using Mysql 4.1.7, phpmyadmin 2.6.1. I think there should be a way around this, but can't remember where it resides.

View Replies !
Default Database/table Charset
i'm trying to get UTF-8 working in my PHP app. It's all good now except for one thing.

During the installation process, I use the AdoDB XML Schema class to automatically create the necessary tables from XML files. This is great, but has the drawback that I don't get to specify the Character Set of the new tables, as AdoDb doesn't support that yet. What I'm looking for is the best way to get the desired result: all tables using the UTF-8 charset.

Form what I can understand of the manual, I can set the default charset of the database, then create the tables and they will inherit the charset. However, as my app may not be the only one using this particular database, it's important that I restore the default charset after I've finished the installation.

Does this sound like the right way to go? Basically, I run:

SHOW VARIABLES LIKE 'character_set_database'
...to get the previous default, then set the default to utf8, then install the tables and finally return the charset to whatever it was previously.

View Replies !
Set Default Collation
However I recently tried MySQL 4.1.x and noticed that there have been some changes. My questions are:-

1) The default collation setting is Latin1_swedish_ci. What do I need to change this to in order for my old tables to import correctly? Currently special chars like tm <- trademark import as ? <-Question Marks?

2) How do I set my own default?

3) Is there any way to export a new database back to an old version of MySQL eg 4.1.x -> 4.0.x?

View Replies !
ENGINE=MyISAM DEFAULT CHARSET=latin1;
what is the function of this command
ENGINE=MyISAM DEFAULT CHARSET=latin1;.

View Replies !
Create Table :: Right Syntax To Use Near 'DEFAULT CHARSET=latin1'
Why would the following SQL cause an error when run?

CREATE TABLE `webportal_adminips` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`strip` varchar( 20 ) default NULL ,
`blnactive` enum( 'yes', 'no' ) default NULL ,
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT CHARSET = latin1;

Error I am getting is:

#1064 - 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 'DEFAULT CHARSET=latin1' at line 6

View Replies !
DEFAULT CHARSET=utf8 Problem When Executing Query
CREATE TABLE userdetails (
userid int(11) NOT NULL auto_increment,
loginId varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
firstname varchar(255) default NULL,
lastname varchar(255) default NULL,
email varchar(255) NOT NULL default '',
superuser int(11) default NULL,
createddate datetime default '0000-00-00 00:00:00',
role int(11) NOT NULL default '0',
count int(11) NOT NULL default '0',
PRIMARY KEY (userid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


I am using MySQL 4.0.20.

Without DEFAULT CHARSET=utf8, query is fine.

View Replies !
DEFAULT CHARSET = Latin1 Giving Error On Upload
I have to import the database from local server file to remote server

Issue #1: - DEFAULT CHARSET = latin1 database from local server

when uploading to remote server through phpmyadmin

I get this error

MySQL said: Documentation
#1064 - 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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=3' at line 37.

View Replies !
You Have An Error In Your SQL Syntax Near 'ENGINE=MyISAM DEFAULT CHARSET=latin1'
I have mysql 4.1.16 loaded in one server and the other server has mysql 3.23.58

when i do a mysqldump from 4.1.16 and try to load it on 3.23.58,
i get this error You have an error in your SQL syntax near 'ENGINE=MyISAM DEFAULT CHARSET=latin1'

i cant figure out what i am doing wrong.

View Replies !
Setting The Default Collation For A Specific Connection?
Is it possible to set the default collation for a MySQL connection? (I have MySQL 4.1.22)

I know you can use SET NAMES 'utf8'; for the character set, and can set the collation and character set for the whole server with my.cnf:

default-collation=UTF8_general_ci
default-character-set=UTF8

But is there any way to set the collation for a connection without editing my.cnf? Such that all CREATE TABLE queries and such on that connection automatically use utf8_general_ci as the default collation, rather than latin1_swedish_ci? (without adding DEFAULT CHARSET to each create table query)

View Replies !
DEFAULT CHARSET Error (was "Odd MYSQL Error!! :(")
I keep getting this error

PHP

Error
SQL query:

-- phpMyAdmin SQL Dump
-- version 2.6.4-pl2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 31, 2006 at 09:06 PM
-- Server version: 4.1.19
-- PHP Version: 4.3.11
--
-- Database: `jesse_game`
--
-- Table structure for table `games`
--
CREATE TABLE `games` (

`gameid` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`gametitle` text NOT NULL ,
`gamedesc` text NOT NULL ,
`gamekeywords` text NOT NULL ,
`gamefile` text NOT NULL ,
`gameheight` int( 11 ) NOT NULL default &#390;',
`gamewidth` int( 11 ) NOT NULL default &#390;',
`category` int( 11 ) NOT NULL default &#390;',
`timesplayed` int( 11 ) NOT NULL default &#390;',
`totalvotes` int( 11 ) NOT NULL default &#390;',
`totalvotepoints` int( 11 ) NOT NULL default &#390;',
`rating` int( 11 ) NOT NULL default &#390;',
`gameicon` text NOT NULL ,
`gamestatus` int( 11 ) NOT NULL default &#390;',
`playedtoday` int( 11 ) NOT NULL default &#390;',
`gamelocation` int( 11 ) NOT NULL default &#390;',
`iconlocation` int( 11 ) NOT NULL default &#390;',
`instructions` text NOT NULL ,
`filetype` int( 11 ) NOT NULL default &#391;',
`customcode` text NOT NULL ,
PRIMARY KEY ( `gameid` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =1515;


MySQL said:  

#1064 - 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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=1515' at line 23

PHP

#1064 - 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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=1515' at line 23


View Replies !
Mysql Charset
i5, 'athedsl-06583.otenet.gr', '2006-01-31 18:46:01', '?ia i?ioia oa ueioo oioo U?eooioo', 2
This is what i see as greek => '?ia i?ioia oa ueioo oioo U?eooioo'
I CANNOT work this way.
In the browser when the data are fetched they seem fine(pure greek), in query browser or commnand line thay seem in the above funny way.

View Replies !
MySQL Charset Error
I have arabic data in MySQL DB. I want the query to fetch data in sorted form. but it does not. I have come to know that on run time (or inside Query) you can change the character set and change it to Arabic. Then the data will be sorted according to Arabic. i am using MySQL 4.0.22-standard and PHP Version 4.3.10.

when i run SQL command "SHOW CHARACTER SET" over MySQL. it gives error that i should consult documentation of MySQL for exact syntax for charset. Can anyone plz guide me how should i cope with this situation? is there anything left in installs? or do i need some classes of PHP?

View Replies !
Apache MySQL Charset Error
I keep seeing the following error in my apache error log. Anyone knows how to fix it?
Character set '#33' is not a compiled character set and is not specified in the 'c:mysqlsharecharsetsIndex' file

Problem is, MySQL is installed in C:Program FilesMySQL, not in c:mysql. I don't know why Apache keeps trying to read from the c directory.
My apache version is 2.0.58 and MySQL version 4.1. Can someone provide some insight to this problem?

View Replies !
MySQL Collation
In my phpmyadmin, it shows all the tables as:

Collation: latin1_swedish_ci

What exactly is this collation? And what should I set it if I am using plain english?

View Replies !
MySQL Collation!
System Info:
Linux localhost.localdomain 2.4.21-32.ELsmp #1

mysql Ver 14.7 Distrib 4.1.15, for pc-linux-gnu (i686) using readline 4.3

I am a newbie so please can someone help me!?


I have a dedicated Linux server and I want to det the default collation and character set to utf8.

From what I have read so far I have changed /etc/my.conf to:
old-passwords
default-character-set=utf8

This however has not helped. Do I need to recompile MySQL and if so how do I do it so that I can pass --default-character-set=utf8?

View Replies !
Collation In MySQL
I was wondering what the term Collation means for my MySQL database. Automatically mine is set to latin-spanish or something like that. I don't see anything that has to do with English so I'm chasing my tail here. Help me out with some info plz.

View Replies !
MySQL Collation And Greek
When you create a database with phpMyAdmin by default the collation of the database is latin1_swedish_ci! So you have to be very carefull from the begining to create the database with the right collation, (in my case, greek_general_ci)...

Well, my problem is that I have alreday made this mistake so now I have a database with wrong collation and all my greek content is stored as some crazy characters that I can not read.

In the real site you can see all the content ok and the source looks ok, but using wrong collations in your database is a very bad thing to do.

1. Is there any way to change the encoding of the database?
2. Is there any way to convert my data to a usefull form (greek)?

Any suggestions?

View Replies !
MySQL Collation For Text?
By default MySQL puts text types into latin_swedish collation

.... but is utf08_general_ci better? Is this one more universal?

View Replies !
What Does _bin At Collation Mean In Mysql?
that does collation with latin1_bin mean, expecially _bin? What affects does collation have on data stored in particular character set?

View Replies !
MySQL Setting Collation To Latin1_swedish_ci
No matter how I configure MySQL 4.1.9, I always end up with all of my tables having collation set to "latin1_swedish_ci".

I have tried setting the collation to "latin1_general_ci" but my settings are ignored and all tables show up as "latin1_swedish_ci".

The tables that were created have been created and all data inserted through a PHPMyAdmin SQL file export under a server running MySQL 4.0.22.

Is there any way to fix this and what is might be causing it.

View Replies !
Migration :: Mysql To Mysql Charset
I download an .sql backup of my forum from phpMyAdmin. The host that I use MySQL is using uts8_unicode_ci as charset.

My forums are in turkish. and the other server which I will use my downloaded .sql file uses utf8_general_ci as its charset.

Why I try to import with the command line option; I get an error.

They both have MyISAM, Memory, Merge, Heap, MRG_MyIsam engines.

I think this is a charset issue.
The error looks like;

#1064 - 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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=4' at line 30

saying sth about Auto increment and charset.

View Replies !
MySQL Default Value
When a customer places an order, the database sets the default at "3" which means "not complete" when it is complete and billed, It is assigned a "1"

I want to have it be assigned a new number on all future orders, but no not want it to go back and reset every single past order. If I change the default value number in the database, will it only apply to new orders, or will it change every single record to the new default regardless of their current status?

View Replies !
Default Password Set In Mysql
Can any one tell me if there is a default password set in mysql when installing it. I am sure that i did not give any password while installation process. To confirm it i installed it many times and different versions as well.

I am having following error message:

ERROR 1045: Access denied for user: 'ODBC@localhost' (Using password: NO)

View Replies !
Default Mysql User
I need to know the user name of my "mysql" database so i can connect it to other applications.

So far i haven't created any new profiles, so i'm only prompted to enter the user password when i start up mysql.

Would the default users name in my case be "root" or is that only on unix machines? (i'm running mysql on win2000)


View Replies !
Default Password Of Mysql
I was checking an already used mysql. I dont think their passwords were changed. What is the default passwords for the users( root, mysql, etc)?

View Replies !
Default Value Problem In Mysql
- Database table with a decimal field set to Null and with a default value of 0.00
- PHP page with a form containing a price field which, on submission adds a new record to the table. If the user leaves the price field empty on the form the intention was for the default value to be applied to the field. However, an error is returned to the effect that a valid decimal value was not input.
The form could have a default value of 0.00 displayed to the user and while this overcomes the problem it would be preferable to allow the field to be left blank.
Is it the case that the script is picking up the field as being an empty string and if so how do I get around this?

View Replies !
Need Help - Mysql 5 Default Values
I created a program for mysql 3.23...
We launch on tuesday...
Problem is we are installing it on laptops and are tech guy installed mysql 5 instead of the version we currently use. In the mysql 3 when you make a query if there is a null value in the query it automatically places the default value into the table.
I.E.
Query: INSERT INTO someTable SET someCol=''
Column Default: 'a'
In mysql 5 it throws an error saying the column value is out of range if your trying to insert a null value. I need it to automatically insert the default value.
Is there a way to change the configuration of mysql to automatically insert the default value if a null value is encountered (and the column is a not null setting).
This is really really important,



View Replies !
Default Port Of Mysql
I've installed mySQL-essential-4.1.22-win32.

And it doens't connected to my coldfusion webserver because of port problem.

What is the default port of mySQL-essential-4.1.22-win32?

View Replies !
UTF-8 Charset
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">

with this meta tag i posted atleast 100 rows of data in my mysql table.

But i should have posted them with the UTF-8 charset.

So i should i migrate my table for the UTF-8 charset?

Actuall i want to migrate my whole database.

View Replies !
Other Charset
I want to realize a Project with PHP and mySQL. There would be different Languages and One of this will be japanese.
Now my Questions:
- How do I have to convert the contet to save it in my DB?
- Have I to take care of other problems when doing so?
- Has anybody here done something linke this before and can tell me where the difficulties are?

View Replies !
4.0.24/ Charset
How do I find out and set the charset of a table? Version is 4.0.24

View Replies !
Charset And
The following manual page lists up the supporting character sets.

http://dev.mysql.com/doc/refman/4.1/...-charsets.html

I'd like to know how they are typed in the meta tag in the html header, especially the followings as the latin1 goes to ISO-8859-1.
Quote:
dec8 DEC West European
hp8 HP West European
swe7 7bit Swedish
tis620 TIS-620, windows-874
gbk GBK Simplified Chinese
keybcs2 DOS Kamenicky Czech-Slovak
macce Mac Central European
macroman Mac West European
cp1256 Windows Arabic
cp1257 Windows Baltic
binary Binary pseudo charset






View Replies !
Default MYSQL Server Password
I just installed MySQL server 3.23.58-1. Now I can't find the password en
can's change the settings. Who knows this password?

View Replies !
How To Restore Default Settings Of Mysql
i have dump all things from A computer database to B computer database; but it replace all settings on B computer database, i want to restore all the setting of B like a default settings after installaitonl.

View Replies !
Default Table Type On MySQL 5
I seem to recall reading somewhere that InnoDB was the default table type for MySQL 5. Yet when I did a 'show table types' it indicated that MyISAM was the default type since version 3.

View Replies !
MySQL Admin :: Default User Name?
I created an instance using "MySql Server Instance Config Wizard" then opened MySql Administrator, where I was asked to supply a user name and password for the connection. I did not supply a user name creating the Instance. Is there a default user name? How do I login? Windows XP OS

View Replies !
Default MySQL Return Value For Query
I'm writing a multilingual web site where not all content will necessarily be multilingual. I have a languageid and want to retrieve the content for that language. However, if that content doesn't exist, I would want to retrieve content for the default language.

My ideal query would be something like:

SELECT content FROM page_content WHERE pageid=$pid AND languageid=$userlang IF NO RESULTS WHERE pageid=$pid AND languageid=$defaultlangid

I imagine my made- up 'IF NO RESULTS' directive does not exist. Is there any way to get that kind of functionality from one query? Since I will be having queries all over the site to retrieve different kinds of localized things (image tags, html code, textual content), it would be awesome if I could figure out a way to consolidate.

Maybe there is a way to sort results from this query:

SELECT content FROM page_content where pageid=$pid AND (languageid=$userlang OR languageid=$defaultlang) ORDER BY .... ?

I'm also not sure if the nested boolean will work.

View Replies !
Charset Illusion
the problem is this that I have 2 group of programs with different interaction:

group 1: PHP, MySQL Command Center
group 2: MySQL Query Browser, MySQL Administrator

and I have 2 CREATE TABLE

for 1st CREATE TABLE (greek), group 2 works fine and group 1 display
greek characters like this "?"

for 2st CREATE TABLE (latin1), group 1 works fine and group 2 display
greek characters like this "|"

Until now, I worked with MySQL Command Center but now project is stopped.

So, I must fix this problem.
What's wrong?

----------1----------
CREATE TABLE `anniversaries` (
...........
`event` text NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=greek
----------2----------
CREATE TABLE `anniversaries` (
...........
`event` text NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=latin1
---------------------

View Replies !
Charset Without Recompiling
Can I put a new charset or modify an existing one without recompiling MySQL?
If yes, please tell me how.

View Replies !
A New Charset Without Recompiling
Can I put a new charset or modify an existing one without recompiling MySQL?

View Replies !
Charset :: Koi8_ru
I cannot get koi8r charset working propely after I tried to switch from 4.0.x. In 4.0 I have server running with --default-character-set=koi8_ru and both mysql client and servlet application did what I wanted. After I upgraded to 4.1 gamma I cannot get things working, unless I run mysql client with --default-character-set=koi8r.

I tried to create database with both charset koi8r and utf8 and tried to run server with --default-charset and without - I always can see only ???? instead of koi8 data I tried to put in database.
I apparently miss something even after reading documentation.

View Replies !
Changing Charset
Is there a way to globally overwride the charset in tables?
Somehow I got latin-1 from phpmyadmin. Otherwise I'll loop through the tables and fields and change them all using varchar type.

View Replies !
Charset Variable
how can i change this Charset variable

View Replies !
Greek Charset
I have a form the following table :

CREATE TABLE `messages` (
`ID` int(10) unsigned NOT NULL auto_increment,
`firstname` varchar(80) character set greekNOT NULL default '',
`lastname` varchar(80) character set greek NOT NULL default '',
`town` varchar(80) character set greek NOT NULL default '',
PRIMARY KEY (`ID`)
) ;

i have a form and i insert data into the table and the page tha displays the data has charset=greek. I have also tried charset=windows-1253 , charset = el-utf-8 but it wont show the correct characters.

View Replies !
Problem With Charset
If i use

<?php
$link = mysql_connect('localhost', 'root', 'ip1wrr');
$charset = mysql_client_encoding($link);
printf ("current character set is %s
", $charset);
?>

it writing current character set is latin1_swedish_cs but i want to change it to my languane (czech - cp1280 or utf-8), but i set all like that and it still writing latin1... I want it because i have saved in database possibly Å™eÅ™ich or Äepek or something... But it writing to page ?e?ich, ?epek.

View Replies !
Changing Charset Of A Db
how to change the charset of all tables in a db. Actually the charset ist Latin1, but I need UTF-8. Or is there a SQL-Query that I can use?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved