标签: mysql
如何优化内存512M服务器的MYSQL设置
# 512M 设置: 加到my.ini的[mysqld]下
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 16M
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
从mysql迁移到postgreSQL注意点
1、auto_increment 转换成SERIAL。
2、concat 转换成 || 。
3、date_format 转换成 to_char。
4、ifnull 转换成 coalesce($1, $2)。
5、PostgreSQL 在 HAVING 子句不能使用别名。
select name, count(*) as score
from mytable
group by name
having score > 10
转换成
select name, count(*) as score
from mytable
group by name
having count(*) > 10
如何改变已有数据的MYSQL数据表的字符集
想把office库的字符集从cp850改成latin1。MYSQL手册上说使用 alter table xx convert to character set latin1。试了下不行。忙了半天,发现按以下步骤可以:
- mysqldump –character-sets-dir=..\share\charsets –default-character-set=cp850 office -r office.sql;
- 用notepad++打开office.sql,替换所有cp850为latin1;
- mysql office < office.sql。
应该是我的MYSQL缺省字符集问题。
酒店管理系统数据库比较
酒店管理系统数据库比较
现代酒店管理系统都采用数据库软件,以下是常用数据库的比较:
品牌 | 平台 | 性能 | 价格 | 性价比 |
oracle | Win Linux Unix | 5 | 5 | 1 |
sybase | Win Linux Unix | 4 | 4 | 1 |
sqlserver | Win | 3 | 4 | 0.75 |
foxbase | Win | 1 | 2 | 0.5 |
mysql | Win Linux Unix | 4 | 0.1 | 40 |
Postgres | Win Linux Unix | 5 | 0.1 | 50 |
资深软件是最早在中国酒店2000+酒店管理系统软件里采用mysql数据库的酒店管理系统软件厂商,在2007年推出的国际版中更采用了Postgres数据库。为广大酒店管理系统用户进一步节省了费用。