Chinaunix首页 | 论坛 | 博客
  • 博客访问: 19912630
  • 博文数量: 679
  • 博客积分: 10495
  • 博客等级: 上将
  • 技术积分: 9308
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-18 10:51
文章分类

全部博文(679)

文章存档

2012年(5)

2011年(38)

2010年(86)

2009年(145)

2008年(170)

2007年(165)

2006年(89)

分类: Mysql/postgreSQL

2008-02-12 13:44:15

快速入门

本章主要内容:

·         MySQL directory structure

·         Overview of executables

·         Overview of user interfaces

·         Quick introduction to the MySQL monitor

 

目录结构和简介

        Linux默认安装目录: /usr/local/mysql windows C:\mysql. 包含了bin, scripts,data,docs, sql-bench等目录
        其他目录有:share (包含错误信息), and examples (Windows 下面才有, 使用 libmysql DLL).
 
Bin目录有如下重要工具
 
Mysqladmin,myisamchk,mysqldump,mysqlbinlog,mysqlshow,其中mysqlbinlog用于读取二进制log,在灾难恢复的时候尤其有用.
scripts目录包含了脚本,比如mysqlhotcopy是个很有用的perl脚本,5.0已经在bin目录中.
 
用户接口有:
command-line interface mysql (also known as the MySQL monitor), MySQL Control Center (MySQLCC for short), and phpMyAdmin
其中MySQLCCMySQLCC使用Qt windowing toolkit,是跨平台的工具。
 
phpMyAdmin基于web
 
mysql --i-am-a-dummy -u root不会对数据库进行改变
语句后面要使用分号,\g也是一样的结果
常用操作:
show databases;
use databasename;
show tables;
describe tablename;
\h
source filename
mysql -u username -p < filename
 
 

小结

·         MYSQL最重要的目录是bin,data,docs

·         使用最多的程序是mysqld, mysql, 分别为服务器和客户端

·         访问mysql的客户端有: mysql (command-line), MySQLCC (GUI), and phpMyAdmin (Web-based).

·         Mysql客户端重要的命令行参数有:-u,-p,-h, --i-am-a-dummy

·         The mysql command-line program has many useful command-line

·         查看数据库SHOW DATABASES ;查看表 SHOW TABLES ;查看表的字段

·         退出使用 \q.

·         语句结束 ; or \g

·         可以使用文件重定向执行命令文件.

 

 

·         The most important directories in your MySQL installation are bin (executable programs), data (database data), and docs (documentation).

·         The two programs you will use the most are mysqld, the MySQL server, and mysql, the command-line client.

·         You have a choice of several user interfaces/client programs. We discussed mysql (command-line), MySQLCC (GUI), and phpMyAdmin (Web-based).

·         The mysql command-line program has many useful command-line switches and options. We have discussed -u (to specify username), -p (to log in with a password), -h (to specify the host), and --i-am-a-dummy (for damage-control mode).

·         When logged in, you can use SHOW DATABASES or SHOW TABLES to get a list of what is in the system and DESCRIBE tablename to get information about a particular table.

·         You can log out with \q.

·         You can terminate commands with ; or \g to send them to the server for execution.

·         You can execute a file of commands from inside the client with source filename and from outside the client by using file redirection.

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

chinaunix网友2008-02-12 13:45:31

§2.3 习题和答案 Quiz 1: You would find the MySQL server program in the docs or Docs directory the lib directory the scripts directory the bin directory 2: You would find the MySQL documentation in the docs or Docs directory the lib directory the scripts directory the bin directory 3: You would find mysqlhotcopy in the docs or Docs directory the lib directory the scripts directory the bin directory 4: Commands in the MySQL monitor should be terminat