MySQL 绿色版安装方法图文教程Word格式.docx

上传人:b****6 文档编号:17666572 上传时间:2022-12-08 格式:DOCX 页数:8 大小:159.08KB
下载 相关 举报
MySQL 绿色版安装方法图文教程Word格式.docx_第1页
第1页 / 共8页
MySQL 绿色版安装方法图文教程Word格式.docx_第2页
第2页 / 共8页
MySQL 绿色版安装方法图文教程Word格式.docx_第3页
第3页 / 共8页
MySQL 绿色版安装方法图文教程Word格式.docx_第4页
第4页 / 共8页
MySQL 绿色版安装方法图文教程Word格式.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

MySQL 绿色版安装方法图文教程Word格式.docx

《MySQL 绿色版安装方法图文教程Word格式.docx》由会员分享,可在线阅读,更多相关《MySQL 绿色版安装方法图文教程Word格式.docx(8页珍藏版)》请在冰豆网上搜索。

MySQL 绿色版安装方法图文教程Word格式.docx

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数据库存放位置,必须是Data文件夹名

将修改后的文件另存为my.ini

3、安装MySQL的服务,服务名自己定义为MySQL.

1)、进入DOS窗口

2)、执行安装MySQL服务名的命令:

D:

\AppServ\MySQL\bin\mysqld-installmysql--defaults-file="

\Appserv\MySQL\my.ini"

出现Servicesuccessfullyinstalled.表示安装成功。

然后打开服务窗口(在运行框中输入services.msc即可打开服务窗口,然后可以找到mysql服务了,右键mysql服务属性,在弹出的窗口中可以看到以下信息:

\AppServ\MySQL\bin\mysqld-nt--defaults-file=D:

\Appserv\MySQL\my.inimysql 

则表示mysql会随开机启动而启动!

3)、启动MySQL服务

netstartmysql

MySQL服务正在启动.

MySQL服务无法启动。

4)、登陆MySQL服务器

mysql-uroot-p

Enterpassword:

WelcometotheMySQLmonitor.Commandsendwith;

or\g.

YourMySQLconnectionidis1

Serverversion:

5.1.32-communityMySQLCommunityEdition(GPL)

Type'

help;

'

or'

\h'

forhelp.Type'

\c'

toclearthebuffer.

mysql>

注意:

MySQL的管理员用户名为root,密码默认为空。

5)、查看数据库

showdatabases;

+--------------------+

|Database|

|information_schema|

|mysql|

|test|

3rowsinset(0.02sec)

可以看到MySQL服务器中有三个数据库。

6)、使用数据库

usetest

Databasechanged

7)、查看数据库中的表

showtables;

Emptyset(0.00sec)

8)、创建表ttt

createtablettt(aint,bvarchar(20));

QueryOK,0rowsaffected(0.00sec)

9)、插入三条数据

insertintotttvalues(1,'

aaa'

);

QueryOK,1rowaffected(0.02sec)

insertintotttvalues(2,'

bbb'

QueryOK,1rowaffected(0.00sec)

insertintotttvalues(3,'

ccc'

10)、查询数据

select*fromttt;

+------+------+

|a|b|

|1|aaa|

|2|bbb|

|3|ccc|

3rowsinset(0.00sec)

11)、删除数据

deletefromtttwherea=3;

QueryOK,1rowaffected(0.01sec)

删除后查询操作结果:

2rowsinset(0.00sec)

12)、更新数据

updatetttsetb='

xxx'

wherea=2;

Rowsmatched:

1Changed:

1Warnings:

0

查看更新结果:

|2|xxx|

13)、删除表

droptablettt;

查看数据库中剩余的表:

三、更改MySQL数据库root用户的密码

1、使用mysql数据库

usemysql

2、查看mysql数据库中所有的表

showtables;

+---------------------------+

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

17rowsinset(0.00sec)

3、删除mysql数据库中用户表的所有数据

deletefromuser;

QueryOK,3rowsaffected(0.00sec)

4、创建一个root用户,密码为"

xiaohui"

grantallon*.*toroot@'

%'

identifiedby'

xiaohui'

withgrantoption;

QueryOK,0rowsaffected(0.02sec)

5、查看user表中的用户

selectUserfromuser;

+------+

|User|

|root|

1rowinset(0.00sec)

6、重启MySQL:

更改了MySQL用户后,需要重启MySQL服务器才可以生效。

netstopmysql

MySQL服务正在停止..

MySQL服务已成功停止。

netstartmysql

MySQL服务正在启动.

MySQL服务已经启动成功。

7、重新登陆MySQL服务器

mysql-uroot-pxiaohui

如果修改密码后netstartmysql出现不能启动mysql的1067错误,则可以使用以下办法解决:

使用cmd命令:

\Appserv\mysql\bin\mysqladmin-uroot-pshutdown,然后输入密码,再netstartmysql就没有这个错误提示了!

四、数据库的创建与删除

1、创建数据库testdb

createdatabasetestdb;

2、使用数据库testdb

usetestdb;

3、删除数据库testdb

dropdatabasetestdb;

4、退出登陆

exit

Bye

C:

\DocumentsandSettings\Administrator>

五、操作数据库数据的一般步骤

1、启动MySQL服务器

2、登陆数据库服务器

3、使用某个要操作的数据库

4、操作该数据库中的表,可执行增删改查各种操作。

5、退出登陆。

MySQL修改root密码的多种方法

∙浏览:

5282

∙|

∙更新:

2013-07-2015:

07

∙标签:

root 

XX经验:

方法1:

用SETPASSWORD命令

  mysql-uroot

  mysql>

SETPASSWORDFOR'

root'

@'

localhost'

=PASSWORD('

newpass'

方法2:

用mysqladmin

  mysqladmin-urootpassword"

newpass"

  如果root已经设置过密码,采用如下方法

  mysqladmin-urootpasswordoldpass"

方法3:

用UPDATE直接编辑user表

usemysql;

UPDATEuserSETPassword=PASSWORD('

)WHEREuser='

;

FLUSHPRIVILEGES;

在丢失root密码的时候,可以这样

  mysqld_safe--skip-grant-tables&

  mysql-urootmysql

UPDATEuserSETpassword=PASSWORD("

newpassword"

)WHEREuser='

FLUSHPRIVILEGES

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 外语学习 > 法语学习

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1