young
unread,Sep 3, 2009, 6:34:41 AM9/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 工作记录
1、 卸载原有Mysql
(1) 用rpm –qa | grep mysql 查看是否安装了mysql
(2) 用rpm –e mysql-client-xxxxx 卸载mysql客户端
(3) 用rpm –e mysql-server-xxxxx --nodeps 卸载mysql服务器
(4) 运行命令rm –fr /usr/lib/mysql 和 rm –fr /usr/include/mysql
2、 安装Mysql
(1) 将mysql-client-xxxx.rpm、mysql-server-xxxx.rpm拷贝至服务器
(2) 用rpm –ivh mysql-server-xxxx.rpm安装mysql服务器
(3) 用rpm –ivh mysql-client-xxxx.rpm 安装mysql客户端
(4) 成功安装后,安装目录在/var/lib/mysql下,可通过service mysql start/stop 启动/关闭mysql服
务
3、 配置Mysql服务器
(1) 将目录/usr/share/mysql文件my-medium.cnf拷贝到/etc下,并改名为my.cnf
(2) 修改字符集:修改/etc/my.cnf,在[mysqld]行下添加default-character-set=utf8,重启mysql
服务
(3) 修改存储引擎:修改/etc/my.cnf,在[mysqld]行下添加default-table-type=InnoDB, 重启
mysql服务
(4) 修改事务为非自动提交:修改/etc/my.cnf,在[mysqld]行下添加init_connect='SET
AUTOCOMMIT=0' , 重启mysql服务
(5) 修改事务为非自动提交:修改/etc/my.cnf,在[mysqld]行下添加lower_case_table_names=1 , 重启
mysql服务
4、 配置cpis数据库和用户
(1) 输入命令mysql,进入操作界面,输入create database cpis default character set =
utf8; 创建cpis数据库
(2) 输入grant
select,insert,update,delete,create,drop,references,index,alter on
cpis.* to ‘cpis’@’%’ identified by ‘cpis’; 创建cpis用户
(3) 输入grant
select,insert,update,delete,create,drop,references,index,alter on
cpis.* to cpis@localhost; 追加本地权限
5、 配置mysql安全设置
(1) 修改root密码:mysql –uroot 进入mysql操作界面,输入set password=password
(‘newpassword’); newpassword为新密码
(2) 输入drop user ‘’@’localhost’; 删除匿名帐号