Mysql数据库学习心得(5)

来源:互联网 发布:数码暴龙网络侦探v字头 编辑:程序博客网 时间:2024/05/14 11:40
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

 

.安装phpMyAdmin

  Mysql图形界面管理器phpMyAdmin是一套以php3写成,针对Mysql数据库系统的Web管理界面。它可以很方便地以图形化界面,来对Mysql数据库里的字段、数据进行增加、删除等的动作,更可以做数据库本身的增删管理;phpMyAdmin可以管理整个Mysql服务器(需要超级用户),也可以管理单个数据库。另外,您也可以通过使用这个图形化界面来学习SQL正确的

语法,直至熟练掌握。那要等到你看过Mysql手册中相关的部分。你可以到http://www.phpwizard.net/phpMyAdmin/去下载最新的版本。

  首先,将phpMyAdmin软件包解到一个目录下。

  1.修改文档config.inc.php3。

  将原来的设定:

  ⧼SPAN class=SpellE>cfgServers[1]['host'] = ''; // Mysql hostname

  ⧼SPAN class=SpellE>cfgServers[1]['port'] = ''; // Mysql port - leave blank fordefault port

  ⧼SPAN class=SpellE>cfgServers[1]['adv_auth'] = false; // Use advanced authentication?

  ⧼SPAN class=SpellE>cfgServers[1]['stduser'] = ''; // Mysql standard user (only needed with advanced auth)

  ⧼SPAN class=SpellE>cfgServers[1]['stdpass'] = ''; // Mysql standard password (only needed with advanced auth)

  ⧼SPAN class=SpellE>cfgServers[1]['user'] = ''; // Mysql user (only needed withbasic auth)

  ⧼SPAN class=SpellE>cfgServers[1]['password'] = ''; // Mysql password (only needed with basic auth)

  ⧼SPAN class=SpellE>cfgServers[1]['only_db'] = ''; // If set to a db-name, only this db is accessible

  ⧼SPAN class=SpellE>cfgServers[1]['verbose'] = ''; // Verbose name for this host -leave blank to show the hostname

  :

  :

  require("english.inc.php3");

  修改成:

  ⧼SPAN class=SpellE>cfgServers[1]['host'] = 'Mysql Server的hostname'; //填入您的Mysql Server的主机名称

  ⧼SPAN class=SpellE>cfgServers[1]['port'] = ''; //填入连结Mysql的port,不填则以预设的port进行连结

  ⧼SPAN class=SpellE>cfgServers[1]['adv_auth'] = true; //改成true则进入phpMyAdmin必须先身份认证

  ⧼SPAN class=SpellE>cfgServers[1]['stduser'] = 'root'; // Mysql使用者的帐号

  ⧼SPAN class=SpellE>cfgServers[1]['stdpass'] = '密码'; // Mysql使用者的密码

  ⧼SPAN class=SpellE>cfgServers[1]['user'] = 'root'; // Mysql管理帐号

  ⧼SPAN class=SpellE>cfgServers[1]['password'] = '密码'; // Mysql管理密码

  ⧼SPAN class=SpellE>cfgServers[1]['only_db'] = ''; //指定管理的资库名称,不填则可以管理整个Server

  ⧼SPAN class=SpellE>cfgServers[1]['verbose'] = ''; //指定Mysql的名称,不填则使用系统本身的hostname

  :

  :

  require("chinese_gb.inc.php3"); //将语言改成中文

  说明:

  (1)因本管理接口,可以以一个接口,管理多个Mysql Server,所以可以在config.inc.php3中找到

  ⧼SPAN class=SpellE>cfgServers[1]...

  ⧼SPAN class=SpellE>cfgServers[1]...

  ⧼SPAN class=SpellE>cfgServers[1]...

  :

  ⧼SPAN class=SpellE>cfgServers[2]...

  ⧼SPAN class=SpellE>cfgServers[2]...

  ⧼SPAN class=SpellE>cfgServers[2]...

  其中[1]代表第一个Mysql Server,[2]代表第二个Mysql Server,您要管理的Mysql Server超过三台以上,您可以依照同样的?述,增加[4].....下去!

  (2)若您的Mysql Server与http Server是同一台,则⧼SPAN class=SpellE>cfgServers[1]['host'] =可直接填入localhost。

  最后,打开流览器,输入你的网址/phpMyAdmin之后您会看到一个密码验证的小窗口,输入您的Mysql管理帐号及密码,即可成功地看到phpMyAdmin的管理画面。通过phpmyadmin,你就可以图形化的、方便的管理你的所有数据库了。

  五.小结

  通过以上的学习和操作,终于可以自由操作Mysql数据库了,也可以轻车熟路的使用php或者asp调用Mysql了。最后,笔者要特别感谢开发了Mysql并且免费贡献的天才以及在网上提供Mysql使用说明的大虾们。

 <script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击