文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>MYSQL 教程 §2, 快速入门

MYSQL 教程 §2, 快速入门

时间:2008-02-12  来源:oychw

§2, 快速入门

本章主要内容:

·         MySQL directory structure

·         Overview of executables

·         Overview of user interfaces

·         Quick introduction to the MySQL monitor

 

§2.1  MYSQL目录结构和简介

        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
www.mysql.com/downloads/mysqlcc.html
www.mysql.com/products/mysqlcc/install.html
www.phpmyadmin.net/
 
mysql --i-am-a-dummy -u root不会对数据库进行改变
语句后面要使用分号,\g也是一样的结果
常用操作:
show databases;
use databasename;
show tables;
describe tablename;
\h
source filename
mysql -u username -p < filename
 
 

§2.2  小结

·         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.

相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载