Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MySQL³£ÓÃÖ¸ÁºÏ


¼ÇÁËһЩÓà Windows µÄÃüÁîÐÐÀ´²Ù×÷ MySQL µÄÖ¸Áî¡£
ÕªÒª
Á¬½á MySQL
->mysql -u username -p
username ÊÇÄãµÄÕʺÅÃû³Æ¡£
Ô¶³ÌÁ¬½á
->mysql -h hostname -u username -p
hostname ÊÇ MySQL Ö÷»úµÄÃû³Æ¡£
ÏÔʾȫ²¿µÄÊý¾Ý¿â
SHOW DATABASES;
mysql ÊÇ MySQL ÓÃÀ´´¢´æÕʺźÍȨÏÞµÄÊý¾Ý¿â£¬²»ÄÜɾ³ý¡£
Ñ¡ÔñÊý¾Ý¿â
USE database_name;
ÏÔʾÊý¾Ý¿âÀïµÄ×ÊÁϱí
SHOW TABLES;
ÏÔʾ×ÊÁϱíµÄÐÅÏ¢
DESCRIBE table_name;
×¢Ïú MySQL ÏÔʾÆ÷
\q
SQL µÄÖ´ÐÐÖ¸Áî¿ÉÒÔ´ÓÎı¾ÎļþÄÚÊäÈë¡£
SOURCE file_name
Èç¹ûûÓеÇÈë MySQL µÄÏÔʾÆ÷£¬Óãº
->mysql -u username -p < file_name
Primary key - ÓÃÀ´Ê¶±ð×Ö¶ÎµÄ key¡£
Foreign key - ´ú±íÁ¬½áµÄ×ÊÁÏ±í¡£ÔÙÁíÒ»¸ö×ÊÁϱíÀïµÄ primary key¡£
ʹÓà MySQL
½¨Á¢Êý¾Ý¿â
CREATE DATABASE employee;
Õâ»á½¨Á¢Ò»¸ö½Ð employee µÄÊý¾Ý¿â¡£
½¨Á¢×ÊÁϱí
CREATE TABLE table_name (table definition) [type=table_type];
ÍêÕû¸ñʽ£º
³ÌÐò´úÂë:
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] table_name [(create_definition, ...)]
[table_options] [select_statement];
or
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] table_name LIKE old_table_name;
create_definition:
col_name TYPE [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT]
    [PRIMARY KEY] [reference_definition]
or  PRIMARY KEY (index_col_name,...)
or  KEY [index_name] (index_col_name,...)
or  INDEX [index_name] (index_col_name,...)
or  UNIQUE [INDEX] [index_name] (index_col_name,...)
or FULLTEXT [INDEX] [index_name] (index_col_name,...)
or    [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
    [reference_definition]
or  CHECK (expression)
TEMPORARY ¹Ø¼ü´ÊÊÇÓÃÀ´½¨Á¢ÔÝʱµÄ×ÊÁÏ±í£¬µ±ÄãµÄÁ¬½á½×¶Î½áÊøºó»á×Ô¶¯É¾³ý¡£
CREATE TEMPORARY TABLE table_name;
IF NOT EXISTS Ö»ÓÐÔÚ×ÊÁÏ±í²»´æÔÚʱ²Å»á½¨Á¢¡£
CREATE TABLE IF NOT EXISTS table_name;
LIKE old_table_name »áÒÀÕÕ old_table_name µÄ¹¹ÔìÀ´½¨Á¢ÐµÄ×ÊÁÏ±í¡£
×ֶζ¨Òå (column definition) ¿ÉÓõÄÑ¡Ï
NOT NULL »ò NULL À´¶¨Òå×ֶβ»ÄܰüÀ¨ NULL (NOT NULL) »ò¿ÉÒÔ°üÀ¨ NULL (NULL)¡£
ĬÈÏÖµÊ


Ïà¹ØÎĵµ£º

mysql³£ÓÃÃüÁî

1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖØ¸´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âǰ£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°È ......

how to install apache, PHP and MySQL on Linux 3

how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled
with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE
9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all
Linux-like operating ......

mysql °²×°

Ò»¡¢°²×°
#
yum -y install mysql-server
¶þ¡¢ÅäÖÃ
# vi /etc/my.cnf¡¡ ← ±à¼­MySQLµÄÅäÖÃÎļþ
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility pack ......

È¡mysql±íºÍ×Ö¶Î×¢Ê͵ÄsqlÓï¾ä

½ñÌìÕÒµ½ÁËÈ¡mysql±íºÍ×Ö¶Î×¢Ê͵ÄÓï¾ä
È¡×Ö¶Î×¢ÊÍ
SELECT COLUMN_NAME ÁÐÃû, DATA_TYPE ×Ö¶ÎÀàÐÍ, COLUMN_COMMENT ×Ö¶Î×¢ÊÍ
from INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'companies'##±íÃû
AND table_schema = 'testhuicard'##Êý¾Ý¿âÃû
AND column_name LIKE 'c_name'##×Ö¶ÎÃû
--------------------------- ......

MySQL+PHPÂÒÂëÔ­ÀíÓë½â¾ö

±¾ÎÄ´Ó http://tech.ddvip.com/2009-02/1235627800109815.html ×°ÔØ,·Ç³£¸Ðл×÷Õß!
MySQL+PHP²úÉúÂÒÂëÔ­Òò£º
¡¡¡¡¡ô MySQLÊý¾Ý¿âĬÈϵıàÂëÊÇutf8,Èç¹ûÕâÖÖ±àÂëÓëÄãµÄPHPÍøÒ³²»Ò»ÖÂ,¿ÉÄܾͻáÔì³ÉMySQLÂÒÂ룻
¡¡¡¡¡ô MySQLÖд´½¨±íʱ»áÈÃÄãÑ¡ÔñÒ»ÖÖ±àÂë,Èç¹ûÕâÖÖ±àÂëÓëÄãµÄÍøÒ³±àÂë²»Ò»ÖÂ,Ò²¿ÉÄÜÔì³ÉMySQLÂÒÂ룻
¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ