Chinaunix首页 | 论坛 | 博客
  • 博客访问: 104399
  • 博文数量: 28
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 300
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-10 09:48
文章分类

全部博文(28)

文章存档

2010年(1)

2009年(27)

我的朋友

分类: Mysql/postgreSQL

2009-07-24 16:51:33

环境redhat 5.2
一、使用源码包安装Mysql
  
shell> groupadd mysql    
shell> useradd -g mysql mysql 
shell> tar -xzvf mysql-5.0.18.tar.gz  
shell> cd  mysql-5.0.18
shell> ./configure --prefix=/usr/local/mysql --with-charset=gb2312
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql       mysql_install_db创建MySQL授权表
 
shell> chown -R root  .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &     后台启动MySQL
二、连接和操作。
shell> mysql
mysql> SHOW DATABASES;
mysql> USE test
Database changed
创建并选择数据库
mysql>CREATE DATABASE zwt;
Query OK, 1 row affected (0.03 sec)
mysql> use zwt
Database changed

mysql> show tables;
Empty set (0.00 sec)


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