MYSQLÊý¾Ý¿âʵÓÃѧϰ×ÊÁÏÖ®³£ÓÃÃüÁºÏ
MysqlÊý¾Ý¿âÊÇÒ»¸ö¶àÓû§£¬¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â£¬ÊÇÒ»¸ö¿Í»§»ú/·þÎñÆ÷½á¹¹µÄÓ¦ÓóÌÐò¡£ËüÊǶԸöÈËÓû§ºÍÉÌÒµÓû§ÊÇÃâ·ÑµÄ.
MysqlÊý¾Ý¿â¾ßÓÐÒÔÏÂÓŵ㣺
1.ͬʱ·ÃÎÊÊý¾Ý¿âµÄÓû§µÄÊýÁ¿²»ÊÜÏÞÖÆ
2.¿ÉÒÔ±£´æ³¬¹ý5ǧÍòÌõµÄ¼Ç¼
3.ÊÇÄ¿Ç°Êг¡ÉÏÏÖÓÐÊý¾Ý¿â²úÆ·ÖÐÔËÐÐËÙ¶È×î¿ìµÄÊý¾Ý¿âϵͳ
4.Óû§È¨ÏÞÉèÖüòµ¥¡¢ÓÐЧ¡£
MysqlÊý¾Ý¿â³£ÓÃÃüÁ
Æô¶¯MysqlÊý¾Ý¿â
C:>cd Mysql5.0bin
C:Mysql5.0bin>mysqld –install °²×°Mysql·þÎñ
C:Mysql5.0bin>net start mysql Æô¶¯Mysql·þÎñ
ÇëÇóµÄ·þÎñÒѾÆô¶¯¡£
Á¬½Ómysql
Óû§ÐèÒªÌṩMysqlµÄÓû§ÃûºÍÃÜÂëÀ´Á¬½Ó·þÎñÆ÷£¬Èç¹û·þÎñÆ÷²»ÊÇÔÚ±¾»ú£¬Ôò»¹ÐèÒªÒ»¸öÖ÷»úÃû»òIPÀ´Ö¸¶¨·þÎñÆ÷µÄλÖá£
C:Mysql5.0bin>mysql -h localhost -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 6 to server version: 5.0.18-nt
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql>
ʹÓÃÒ»Ìõ¼òµ¥µÄ²éѯÓï¾ä
mysql> select version(),current_date;
mysql> select version();select now();
н¨»òɾ³ýÒ»¸öÊý¾Ý¿â
Mysql>create database mydb;
Mysql> drop database mydb;
´ò¿ªµÄÊý¾Ý¿âµÄÃüÁî
mysql> use mysql
Database changed
²é¿´Êý¾Ý¿âµÄÃüÁî
mysql> show databases;
²é¿´Êý¾Ý±íµÄÏêϸ½á¹¹
mysql> desc func;
н¨Êý¾Ý¿â
mysql> create database school;
Query OK, 1 row affected (0.00 sec)
н¨±í
mysql> create table user01(
-> id varchar(20) NOT NULL,
-> userName varchar(10) NOT NULL,
-> age int(11) default'0',
-> sex char(2) NOT NULL default'm',
-> PRIMARY KEY (id)
-> )TYPE=InnoDB;
Query OK, 0 rows affected, 1 warning (0.02 sec)mysql>desc student;
²åÈëºÍɾ³ý±íÖеÄÊý¾Ý
Create table student(stuName varchar(20),age varchar(20),id varchar(20),set0 char(1));
²åÈë
mysql> insert into student(id,stuName) values('1','tomcat');
Query OK, 1 row affected (0.00 sec)
ɾ³ý
mysql> delete from student where id='1';
Query OK, 1 row affected (0.01 sec)
ɾ³ý±íÖÐËùÓÐÊý¾Ý
mysql> truncate table student
Ïà¹ØÎĵµ£º
¡¡ÍøÉÏÓкܶàµÄÎÄÕ½ÌÔõôÅäÖÃMySQL·þÎñÆ÷£¬µ«¿¼Âǵ½·þÎñÆ÷Ó²¼þÅäÖõIJ»Í¬£¬¾ßÌåÓ¦ÓõIJî±ð£¬ÄÇЩÎÄÕµÄ×ö·¨Ö»ÄÜ×÷Ϊ³õ²½ÉèÖòο¼£¬ÎÒÃÇÐèÒª¸ù¾Ý×Ô¼ºµÄÇé¿ö½øÐÐÅäÖÃÓÅ»¯£¬ºÃµÄ×ö·¨ÊÇMySQL·þÎñÆ÷Îȶ¨ÔËÐÐÁËÒ»¶Îʱ¼äºóÔËÐУ¬¸ù¾Ý·þÎñÆ÷µÄ”״̬”½øÐÐÓÅ»¯¡£
mysql> show global status;
¡¡¡¡¿ÉÒÔÁгöMySQL·þÎ ......
1 °²×°MySQL5
ÓÃÏÂÁÐÃüÁî°²×°MySQL£º
yum install mysql mysql-server
È»ºóÎÒÃÇΪMySQL´´½¨ÏµÍ³Æô¶¯Á´½Ó£¨ÕâÑùµÄ»°£¬MySQL¾Í»áËæ×ÅϵͳÆô¶¯¶øÆô¶¯£©£¬²¢Æô¶¯MySQL·þÎñÆ÷£º
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
ÔËÐÐ
mysqladmin -u root password yourrootsqlpassword
À´ÎªrootÓû§ÉèÖà ......
ÐÞ¸Älinux·þÎñÆ÷µÄhttpÅäÖÃÖ®ºó£¬±ØÐëÖØÆôApache·þÎñ£¬ÃüÁîΪ£º /etc/rc.d/init.d/httpd restart
chown -R mysql:mysql Ŀ¼Ãû ¸Ä±äÎļþÊôÐÔ
mysqladmin -u root -p password 'new password' ÉèÖÃÃÜÂë
apt-get remove ɾ³ýÈí¼þ
apt-get clean ÇåÀí
/etc/rc.d/init.d/mysqld restart
php ¾ÍÅäÖÃÁËsession Ö÷ ......
PHPnow ÊÇʲô?
Win32 ÏÂÂÌÉ«Ãâ·ÑµÄ Apache + PHP + MySQL »·¾³Ì×¼þ°ü¡£
¼òÒ×°²×°¡¢¿ìËٴ֧³ÖÐéÄâÖ÷»úµÄ PHP »·¾³¡£¸½´ø PnCp.cmd ¿ØÖÆÃæ°å£¬°ïÖúÄã¿ìËÙÅäÖÃÄãµÄÌ×¼þ£¬Ê¹Ó÷dz£·½±ã¡£
PHPnow ÊÇÂÌÉ«µÄ£¬½âѹºóÖ´ÐÐ Init.cmd ³õʼ»¯£¬¼´¿ÉµÃµ½Ò»¸ö PHP + MySQL »·¾³¡£
È»ºó¾Í¿ÉÒÔÖ±½Ó°²×° Discuz!, PHPWind, ......