最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

MySQL 綠色版安裝方法圖文教程

 更新時(shí)間:2012年01月09日 22:35:35   作者:  
MySQL 綠色版安裝方法教程,需要的朋友可以參考下。
一、下載,這里使用綠色解壓縮版

http://mirror.services.wisc.edu/mysql/Downloads/MySQL-5.1/mysql-noinstall-5.1.32-win32.zip

二、配置MySQL的參數(shù)

1、解壓縮綠色版軟件到D:\AppServ\MySQL
設(shè)置系統(tǒng)環(huán)境變量, 在Path中添加 D:\AppServ\MySQL\bin; 





2、修改D:\AppServ\MySQL\my-small.ini文件內(nèi)容,添加紅色內(nèi)容

[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
default-character-set=gbk

[mysqld]
port = 3306
socket = /tmp/mysql.sock
default-character-set=gbk
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
basedir=D:\Appserv\MySQL\
datadir=D:\Appserv\MySQL\Data\
#basedir是mysql安裝目錄;#datadir是mysql數(shù)據(jù)庫(kù)存放位置,必須是Data文件夾名

將修改后的文件另存為my.ini

3、安裝MySQL的服務(wù),服務(wù)名自己定義為MySQL.
1)、進(jìn)入DOS窗口
2)、執(zhí)行安裝MySQL服務(wù)名的命令:
D:\AppServ\MySQL\bin\mysqld-nt -install mysql --defaults-file="D:\Appserv\MySQL\my.ini"
出現(xiàn)Service successfully installed.表示安裝成功。

然后打開(kāi)服務(wù)窗口(在運(yùn)行框中輸入services.msc即可打開(kāi)服務(wù)窗口,然后可以找到mysql服務(wù)了,右鍵mysql服務(wù)屬性,在彈出的窗口中可以看到以下信息:)
D:\AppServ\MySQL\bin\mysqld-nt --defaults-file=D:\Appserv\MySQL\my.ini mysql  則表示mysql會(huì)隨開(kāi)機(jī)啟動(dòng)而啟動(dòng)!


3)、啟動(dòng)MySQL服務(wù)
net start mysql
MySQL服務(wù)正在啟動(dòng) .
MySQL服務(wù)無(wú)法啟動(dòng)。

4)、登陸MySQL服務(wù)器
mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.32-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

注意:MySQL的管理員用戶(hù)名為root,密碼默認(rèn)為空。

5)、查看數(shù)據(jù)庫(kù)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.02 sec)

可以看到MySQL服務(wù)器中有三個(gè)數(shù)據(jù)庫(kù)。

6)、使用數(shù)據(jù)庫(kù)
mysql> use test
Database changed

7)、查看數(shù)據(jù)庫(kù)中的表
mysql> show tables;
Empty set (0.00 sec)

8)、創(chuàng)建表ttt
mysql> create table ttt(a int,b varchar(20));
Query OK, 0 rows affected (0.00 sec)

9)、插入三條數(shù)據(jù)
mysql> insert into ttt values(1,'aaa');
Query OK, 1 row affected (0.02 sec)

mysql> insert into ttt values(2,'bbb');
Query OK, 1 row affected (0.00 sec)

mysql> insert into ttt values(3,'ccc');
Query OK, 1 row affected (0.00 sec)

10)、查詢(xún)數(shù)據(jù)
mysql> select * from ttt;
+------+------+
| a | b |
+------+------+
| 1 | aaa |
| 2 | bbb |
| 3 | ccc |
+------+------+
3 rows in set (0.00 sec)

11)、刪除數(shù)據(jù)
mysql> delete from ttt where a=3;
Query OK, 1 row affected (0.01 sec)

刪除后查詢(xún)操作結(jié)果:
mysql> select * from ttt;
+------+------+
| a | b |
+------+------+
| 1 | aaa |
| 2 | bbb |
+------+------+
2 rows in set (0.00 sec)

12)、更新數(shù)據(jù)
mysql> update ttt set b = 'xxx' where a =2;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

查看更新結(jié)果:
mysql> select * from ttt;
+------+------+
| a | b |
+------+------+
| 1 | aaa |
| 2 | xxx |
+------+------+
2 rows in set (0.00 sec)

13)、刪除表
mysql> drop table ttt;
Query OK, 0 rows affected (0.00 sec)

查看數(shù)據(jù)庫(kù)中剩余的表:
mysql> show tables;
Empty set (0.00 sec)

三、更改MySQL數(shù)據(jù)庫(kù)root用戶(hù)的密碼

1、使用mysql數(shù)據(jù)庫(kù)
mysql> use mysql
Database changed

2、查看mysql數(shù)據(jù)庫(kù)中所有的表
mysql>show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| proc |
| procs_priv |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
17 rows in set (0.00 sec)

3、刪除mysql數(shù)據(jù)庫(kù)中用戶(hù)表的所有數(shù)據(jù)
mysql> delete from user;
Query OK, 3 rows affected (0.00 sec)

4、創(chuàng)建一個(gè)root用戶(hù),密碼為"xiaohui"。
mysql>grant all on *.* to root@'%' identified by 'xiaohui' with grant option;
Query OK, 0 rows affected (0.02 sec)

5、查看user表中的用戶(hù)
mysql> select User from user;
+------+
| User |
+------+
| root |
+------+
1 row in set (0.00 sec)

6、重啟MySQL:更改了MySQL用戶(hù)后,需要重啟MySQL服務(wù)器才可以生效。
net stop mysql
MySQL 服務(wù)正在停止..
MySQL 服務(wù)已成功停止。

net start mysql
MySQL 服務(wù)正在啟動(dòng) .
MySQL 服務(wù)已經(jīng)啟動(dòng)成功。

7、重新登陸MySQL服務(wù)器
mysql -uroot -pxiaohui
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.32-community MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

如果修改密碼后net startmysql出現(xiàn)不能啟動(dòng)mysql的1067錯(cuò)誤,則可以使用以下辦法解決:
使用cmd命令:D:\Appserv\mysql\bin\mysqladmin -uroot -p shutdown,然后輸入密碼,再net start mysql 就沒(méi)有這個(gè)錯(cuò)誤提示了!

四、數(shù)據(jù)庫(kù)的創(chuàng)建與刪除

1、創(chuàng)建數(shù)據(jù)庫(kù)testdb
mysql> create database testdb;
Query OK, 1 row affected (0.02 sec)

2、使用數(shù)據(jù)庫(kù)testdb
mysql> use testdb;
Database changed

3、刪除數(shù)據(jù)庫(kù)testdb
mysql> drop database testdb;
Query OK, 0 rows affected (0.00 sec)

4、退出登陸
mysql>exit
Bye

C:\Documents and Settings\Administrator>

五、操作數(shù)據(jù)庫(kù)數(shù)據(jù)的一般步驟


1、啟動(dòng)MySQL服務(wù)器
2、登陸數(shù)據(jù)庫(kù)服務(wù)器
3、使用某個(gè)要操作的數(shù)據(jù)庫(kù)
4、操作該數(shù)據(jù)庫(kù)中的表,可執(zhí)行增刪改查各種操作。
5、退出登陸。

相關(guān)文章

最新評(píng)論

霍山县| 依兰县| 江门市| 禹州市| 皮山县| 阳谷县| 安新县| 建瓯市| 双城市| 宽甸| 津南区| 太白县| 泸水县| 德令哈市| 丰顺县| 津南区| 昌图县| 普定县| 漳浦县| 西藏| 铜鼓县| 定远县| 讷河市| 观塘区| 焦作市| 无棣县| 临澧县| 河池市| 南京市| 通城县| 渝北区| 峨山| 定安县| 合水县| 霍城县| 固安县| 云梦县| 自贡市| 南雄市| 阿拉善盟| 盐亭县|