Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2027796
  • 博文数量: 213
  • 博客积分: 10474
  • 博客等级: 上将
  • 技术积分: 2149
  • 用 户 组: 普通用户
  • 注册时间: 2005-05-05 16:53
个人简介

顺着天性做事,逆着个性做人.

文章分类

全部博文(213)

文章存档

2020年(3)

2015年(1)

2014年(1)

2013年(1)

2012年(4)

2011年(8)

2010年(36)

2009年(17)

2008年(38)

2007年(25)

2006年(37)

2005年(42)

分类: Mysql/postgreSQL

2007-07-05 11:19:45

当前Mysql版本4.0.26,升级版本为5.0.17。库的升级。 (注:以下运行为root用户,密码为net03)
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 -pnet03
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密码

x:\mysql\bin>mysql -uroot -pnet03
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>set password for );

阅读(3200) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~