专业网络服务提供商
关于进一步加强国内域名注册信
信产部、公安部全面开展依法打
“感恩回报,传递激情” —书生
关于2009年春节期间公司有关活
关于总部基地机房升级断网通知
关于网通服务器迁址的紧急通知
国研IDC机房进行设备升级割接通
关于上调中文域名注册和续费价
英文CN域名规则调整通知
关于部份服务器升级南北双通服
首页帮助中心数据库正文

Mysql数据库从4.0.x到4.1.x以上版本的升级方法

当前Mysql版本4.0.26,升级版本为5.0.17。库的升级。 (注:以下运行为root用户,密码lanmang)
1.从4.0.26版本导出数据库
x:\mysql\bin>mysqldump -uroot -planmang --add-drop-table --allow-keywords vhost > C:\vhost.sql;
2.修改vhost.sql,在首行添加set names 'gbk';
3.在新版本中新建同名数据库
x:\mysql\bin>mysql -uroot -planmang
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4793 to server version: 5.0.17-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>create database `vhost` default character set gbk collate gbk_chinese_ci;
4.导入数据库
x:\mysql\bin>mysql -uroot -planmang vhost < c:\vhost.sql

备注:
升级后需要用old_password函数重置mysql的root密码

Copyright © 2000 - 2008 北京贰度网络科技发展有限公司 Morecn.Inc
《中华人民共和国电信与信息服务业务经营许可证》编号:京ICP证05007082号