分类: LINUX
2009-07-11 22:39:05
1. 找到相关的安装包并解压到当前目录
gunzip mysql-
gunzip gcc-
gunzip shutils-
gunzip ncurses-5.6-sol9-sparc-local.gz
gunzip openssl-
gunzip zlib-
gunzip zlib-
gunzip zlib-
gunzip zlib-
2. 依次安装如上解压包
Pkgadd –d 包名称------------安装方法相同此处只以安mysql-
Pkgadd –d mysql-
3.进入mysql的安装目录初始化数据库
Cd /usr/local/mysql/bin/
./mysql_install_db
4.修改mysql安装目录的属组和属主
Chown -R mysql:mysql /usr/local/mysql
5.链接启动脚本文件
为了引擎随系统自动启动要链接个启动脚本:ln –s /etc/init.d/mysqld /etc/rc3.d/S96mysql
6.编辑文件/etc/my.cnf
cp /usr/local/mysql/share/mysql/my-small.cnf /etc/my.cnf
vi /etc/my.cnf
键入 "old-password" 在 [mysqld]选项
7.启动数据库引擎
/etc/init.d/mysqld start
mysql>create database Xtradb;
mysql>use Xtradb;
mysql> create table Xtra_Astatus(
AccountStatusId tinyint(4) not null,
AccountStatus varchar(10),
primary key(AccountStatusId)
);
mysql> create table Xtra_Event(
EventId tinyint(4) not null,
Event varchar(20),
primary key(EventId)
);
mysql> create table Xtra_History(
LicenseKey varchar(10),
EventDate datetime,
EventId tinyint(4),
primary key(LicenseKey,EventDate)
);
mysql> create table Xtra_Key(
LicenseKey varchar(10),
Password varchar(6),
VenderId varchar(6),
AccountStatusId tinyint(3) unsigned default 0,
ServiceLength smallint(5) unsigned default 0,
Registered datetime,
Pguid varchar(40),
Mail varchar(60),
primary key(LicenseKey))
;
mysql> create table Xtra_Vender(
VenderId varchar(6),
VenderName varchar(60),
primary key(VenderId)
);
3. 向相关的表中插入数据
insert into mysql.user (host,user,password) values('localhost','qubaoquan',password('123456'));
flush privileges;
5. 给用户授权
grant all on Xtradb .* to qubaoquan@localhost identified by '123456';
6. 改变为旧的验证方式
在创建用户设置密码的时候格式为:
set password for qubaoquan@localhost=old_password(‘
然后从新启动数据库引擎:/etc/init.d/mysqld restart
7. 为安全起见给root用户设密码
set password for root@'localhost'=old-password('123456');