LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 862|回复: 6

mysql编译安装棘手问题!求救!!!!

[复制链接]
发表于 2005-1-8 15:46:37 | 显示全部楼层 |阅读模式
我的是mysql3.23.58,
想要解决支持中文查询问题!

命令:
--prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-charset=gb2312  --with-extra-charsets=gbk,gb2312

完成后表的信息:
MyISAM file:         name
Record format:       Fixed length
Character set:       gb2312 (24)
File-version:        1
Creation time:       2005-01-08 10:37:02
Recover time:        2005-01-08 11:23:22
Status:              checked
Data records:                13367  Deleted blocks:                 0
Datafile parts:              13367  Deleted data:                   0
Datafile pointer (bytes):        4  Keyfile pointer (bytes):        3
Datafile length:          12150603  Keyfile length:              1024
Max datafile length: 3904125272062  Max keyfile length:   17179868159
Recordlength:                  909

table description:
Key Start Len Index   Type                     Rec/key         Root  Blocksize

Field Start Length Nullpos Nullbit Type
1     1     2
2     3     4      1       2
3     7     4      1       4
4     11    5      1       8
5     16    200    1       16
6     216   200    1       32
7     416   8      1       64
8     424   100    1       128
9     524   4      2       1
10    528   100    2       2
11    628   4      2       4
12    632   4      2       8
13    636   20     2       16
14    656   4      2       32
15    660   250    2       64

编译成功,经过相应配置,启动、运行都没问题!

查询时仍不支持,总会把不相干的结果列出来!

好多天了,谁知道帮帮忙吧!
发表于 2005-1-8 16:13:01 | 显示全部楼层
--with-extra-charsets=all
 楼主| 发表于 2005-1-8 17:04:49 | 显示全部楼层
首先,我没试过 用--with-extra-charsets=all  编译。

arzon 用这个编译过吗?

我想可能不行,不过一会儿我会试一下的。

我在 /usr/local/mysql/share/mysql/charsets 里

cp1251.conf  dos.conf      hp8.conf        latin1.conf  usa7.conf
cp1257.conf  estonia.conf  hungarian.conf  latin2.conf  win1250.conf
croat.conf   german1.conf  Index           latin5.conf  win1251.conf
danish.conf  greek.conf    koi8_ru.conf    README       win1251ukr.conf
dec8.conf    hebrew.conf   koi8_ukr.conf   swe7.conf

并无gbk.conf 或 gb2312.conf

是不是缺少文件?可源码里也只有这些!

几乎所有的办法我都想也都试过了!

哎!
发表于 2005-1-9 00:43:24 | 显示全部楼层
--with-extra-charsets=all我编译过的
gbk.conf、gb2312.conf我没去找过
我想:你如果在终端里用mysql client查询出错,那会不会和locale、输入法、中文显示有关呢?另外,my.conf放到/etc里了吗?
 楼主| 发表于 2005-1-10 08:32:12 | 显示全部楼层
我是这样做的:
--prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-charset=gb2312 --with-extra-charsets=all
查询仍然不对。
我是telnet到linux下,然后 mysql -uroot -p 进入进行查询的。
至于,my.conf,我是cp supplies-files/my-medium.cnf /etc/my.cnf

以下是my.cnf:
# Example mysql config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# a important part and systems up to 128M very MySQL is used together with
# other programs (like a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# One can in this file use all long options that the program supports.
# If you want to know which options a program support, run the program
# with --help option.

# The following options will be passed to all MySQL clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
set-variable    = key_buffer=16M
set-variable    = max_allowed_packet=1M
set-variable    = table_cache=64
set-variable    = sort_buffer=512K
set-variable    = net_buffer_length=8K
set-variable    = myisam_sort_buffer_size=8M
log-bin
server-id       = 1

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/
#log-update     = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#set-variable   = bdb_cache_size=4M
#set-variable   = bdb_max_lock=10000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#set-variable = innodb_buffer_pool_size=16M
#set-variable = innodb_additional_mem_pool_size=2M
# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
set-variable    = max_allowed_packet=16M

[mysql]
no-auto-rehash
socket=/tmp/mysql.sock
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
set-variable    = key_buffer=20M
set-variable    = sort_buffer=20M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[myisamchk]
set-variable    = key_buffer=20M
set-variable    = sort_buffer=20M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[mysqlhotcopy]
interactive-timeout


你看有什么问题吗?
发表于 2005-1-10 17:48:44 | 显示全部楼层
我想最可能跟telnet的系统有关。如果是windows,输入的汉字可能是unicode编码。
 楼主| 发表于 2005-1-11 08:38:09 | 显示全部楼层
我把查询字段改成bindary 后查询准确点,可还是达不到要求。
我是用php写的程序,查询mysql库!
得到的结果和直接在mysql里查询的一样!

我从网上查到的解决方法都用过了,反正我都没有解决问题!

真不知道些哪些写解决方法的人是否真正测试过,还是我的能力有限!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表