[文章作者:张宴 本文版本:v1.2 最后修改:2007.07.09 转载请注明出处:http://blog.zyan.cc]

需求背景:
  phpMyAdmin是一款不错的MySQL在线管理工具,但phpMyAdmin的cookie登录方式只能输入MySQL数据库的用户名和密码,而想更改MySQL服务器地址和端口则须修改其配置文件config.default.php。当拥有多台数据库服务器,每台服务器又在不同端口启动了多个MySQL服务,每次都修改配置文件就显得很麻烦,因此需要能够在登录界面直接输入MySQL服务器地址和端口的功能。

功能要求:
  假设phpMyAdmin的访问网址为http://192.168.1.25/phpmyadmin/,能够通过输入MySQL服务器地址、端口、用户名、密码登录远程MySQL服务器,对远程数据库进行管理。

修改后的phpMyAdmin登录入口截图:
点击在新窗口中浏览此图片

下载地址:http://ishare.iask.sina.com.cn/cgi-bin/fileid.cgi?fileid=1848024

实现步骤:

1、打开“路径/phpmyadmin/libraries/config.default.php”,查找相关项并修改为以下内容:

2、打开“路径/phpmyadmin/index.php”,在文件最开头增加以下PHP代码:


3、打开“路径/phpmyadmin/libraries/auth/cookie.auth.lib.php”,查找“<!-- Login form -->”这行,在该行下方的第10行后(即“<?php } ?>”这行后)增加以下HTML代码:

图示:
点击在新窗口中浏览此图片


4、创建一个可以从任何IP地址远程连接的MySQL帐号sina

  MySQL默认的帐号为root,密码为空,只允许localhost登录,因此需要创建一个可以从任何IP地址远程连接的MySQL帐号,本例中创建的帐号为sina,密码为zhangyan。使用该帐号从phpMyAdmin登录后,别忘了在“权限”栏中修改密码。

(1)、Linux下的MySQL命令行客户端添加帐号示例:
A.登录使用默认3306端口的MySQL
引用
/usr/local/mysql/bin/mysql -u root -p


B.通过TCP连接管理不同端口的多个MySQL(注意:MySQL4.1以上版本才有此项功能)
引用
/usr/local/mysql/bin/mysql -u root -p --protocol=tcp --host=localhost --port=3307


C.通过socket套接字管理不同端口的多个MySQL
引用
/usr/local/mysql/bin/mysql -u root -p --socket=/tmp/mysql3307.sock


D.通过端口和IP管理不同端口的多个MySQL
引用
/usr/local/mysql/bin/mysql -u root -p -P 3306 -h 127.0.0.1


Enter password: (输入密码,如果密码为空,直接回车)
mysql> (在这儿输入以下的语句)
引用
GRANT ALL PRIVILEGES ON *.* TO 'sina'@'%' IDENTIFIED BY 'zhangyan';

如果提示信息为Query OK, 0 rows affected (0.01 sec),表示执行成功。

(2)、Windows下的MySQL命令行客户端添加帐号示例:
A.管理使用默认3306端口的MySQL
引用
d:\apmserv\mysql\bin\mysql.exe -u root -p


B.管理不同端口的多个MySQL
引用
d:\apmserv\mysql\bin\mysql.exe -u root -p --port=3307


Enter password: (输入密码,如果密码为空,直接回车)
mysql> (在这儿输入以下的语句)
引用
GRANT ALL PRIVILEGES ON *.* TO sina@"%";

如果提示信息为Query OK, 0 rows affected (0.01 sec),表示执行成功。


Tags: , ,
技术大类 » 数据库技术 | 评论(52) | 引用(0) | 阅读(70224)
xujie777 Email
2012-5-18 15:29
We aim to make all our customers satisfy with our products. You will find a variety of Men's fashion louis vuitton uk, fashion Women's cheap Louis Vuitton bags in our store at affordable price.Thinking of interesting ways to cost a milestone birthday? louis vuitton online shop had one of the most distinctive distinctive celebrations.bakery along with living room operated by means of about three moment louis vuitton online Most effective Pastry Chef’s of the year Rammy Nominee Chef’s.
xujie777 Email
2012-5-18 15:29
The choices are likely to be basically countless seeing that louis vuitton outlet occurs with the help of completely new and also incredible concepts once in a while.Louis vuitton Wholesale Monogram Canvas HandbagsLouis Vuitton Collection Beach Handbags louis vuitton bags outlet Damier Canvas HandbagsLouis vuitton Mahina HandbagsLouis Vuitton Monogram Mini Lin HandbagsLouis Vuitton Monogram Multicolore HandbagsLouis vuitton Monogram Vernis HandbagsLouis Vuitton Wholesale Epi Leather HandbagsLouis Vuitton For Men HandbagsLouis Vuitton Damier Canvas WalletsLouis Vuitton Epi Leather WalletsLouis Vuitton Monogram Canvas WalletsLouis Vuitton Monogram Vernis WalleLouis Vuitton ShoesLouis Vuitton Men wallets.As the Authentic Louis Vuitton are so high-priced, so came the louis vuitton handbags outlet.
xujie777 Email
2012-5-18 15:29
coach outlet has become a popular shopping experience for consumers around the world, and a desirable distribution channel for manufacturer's and retailers.Getting your hands on coach outlet store online can be a hefty investment of hundreds of dollars.But do not despair,the Coach Outlet store could be the answer to your prayers.coach outlet online is your smart choice when you want to get the discount Coach accessory. You can find the exact Coach Bags and other accessory you want at a low price that's right for you. My dear friends, let the coach outlet online pave your way into the world of high fashion with their ultimate fashion factory.
Louis Vuitton UK Email Homepage
2012-5-19 16:04
Louis Vuitton UK are diversified in various kinds, handbags, backpacks, portable bags, purses, wallets and pouches. All kinds are popular among the whole word people.That publication was the only French periodical to mention the book, Louis Vuitton is the country's biggest advertiser in the press. 
Coach  Outlet Email Homepage
2012-5-19 16:31
Coach Outlet has distribution, product development, and quality control operations in the United States, France, Italy, Japan, Hong Kong, China, and South Korea.Lewis Frankfort has been involved with Coach for more than 30 years.Metro Rail and ICF engineers are working to address this general problem.  The Coach Outlet Canada provides primarily for the Indian Railways, a number of different coaches - first and second class coaches, pantry and kitchen cars, luggage and brake vans, self propelled coaches. 
Coach  Outlet Email Homepage
2012-5-19 16:41
Cashin worked for Coach Outlet from 1962 until 1974, and revolutionized their product design. Known as an innovator, she instituted the inclusion of side pockets, coin purses, and brighter colors onto the bags.In the Coach Outlet Online shop, a collection of high quality and hottest Coach Shoulder Bags is offered to you. They are all at the best prices you will ever find. 
Coach Outlet Online Email Homepage
2012-5-19 16:49
At the Coach Outlet Online Store, quality products and satisfying service are provided;High safety and prompt delivery is guaranteed.Coach Outlet has always been simple,durable style features to win consumers.The products are more flexible,with easy bleaching,wear characteristics,and simply use a damp cloth. 
Christian Louboutin Email Homepage
2012-5-19 17:42
christian louboutin have own characteristic designs. The beautiful crystals have added the magical finishing touch to countless bridal gowns. Just get some for yourself. The first Men's Boutique, christian louboutin uk Boutique Homme on Rue Jean-Jacques Rousseau in Paris, opened in the summer of 2012.
Louis Vuitton UK Email Homepage
2012-5-19 17:42
Cheap louis vuitton uk wholesale offers a variety of options to satisfy your needs. Some new ones even has fashionable styles fold over flap to disguise the snap closure and a draw string is added for a convenient closure. Louis vuitton outlet online just like a person who want to show himself in front of other people, because he is confident enough, he can attain the respect of other people.
CoachOutlet Email Homepage
2012-5-19 17:42
coach outlet has become a popular shopping experience for consumers around the world, and a desirable distribution channel for manufacturer's and retailers. Coach outlet online develops very quickly because it runs by its own special way and it contents the customers greatly.
Air Jordan Email Homepage
2012-5-19 17:42
Thank you for shopping in our store. We are a reliable online jordan bags seller, specialist in providing numbers of new air jordan bags at amazing price . If you need practical, fashionable and well-known nike dunks, you can consider to choosing on the nike Outlet. Its nice and popular design will make you feel a sense of fresh air.
Nike Air Max Email Homepage
2012-5-19 17:43
This nike air max for sale belongs to the sounding just what are termed as nike air vintage best sellers, many other products and services for the reason that range appearing companies the actual nike air Galliera, plus the nike air outlet monogram selection. nike dunks are made of high leather materials which can be durable and fashionable.They will make you become the focus in the streets or audience.
Louis Vuitton Speedy Email Homepage
2012-5-19 21:05
www.lvbagclassic.com are authorized authentic Louis Vuitton handbags outlet store. All the items at our site are 100% authentic. All our Louis Vuitton handbags will come with the authenticity card, serial Number, dust bag and care booklet. We promise you will be 100% satisfied when you get such cheap authentic Louis Vuitton handbags from us!
Louis Vuitton Neverfull|Louis Vuitton Speedy|Louis Vuitton Alma|Louis Vuitton Artsy
Louis Vuitton Neverfull Email Homepage
2012-5-19 21:05
We are authorized authentic Louis Vuitton handbags outlet store. All the items at our site are 100% authentic. All our Louis Vuitton handbags will come with the authenticity card, serial Number, dust bag and care booklet. We promise you will be 100% satisfied when you get such cheap authentic Louis Vuitton handbags from us! For more information, please visit http://www.authenticlouisvuittonpurses.com/.
xujie222
2012-5-21 10:49
Our online store offers you discounted Designer louis vuitton replica wallet at present. You could find them in desirable quality and price. If you don't mind high class louis vuitton uk, have a good time here.louis vuitton Store Online Handbags can also bring great accuracy as well as practical applicability and fashionable.Have you ever dreamed of being as charming as Madonna? Have you ever thought of becoming an envy of all your friends? If so, come to louis vuitton outlet.<br/>
xujie555
2012-5-21 13:15
coach factory outlet uses graceful accessories to match the classical logo of coach, which is the best combination of coach. The handmade coach products?can make you more charming and graceful.coach factory online provides people many coach goods. If you wish to snatch the coach handbag, then this best method is made for that you like for coach discount.coach factory outlet online is a fashion brand to ensure its quality. With designer coach shoulder bags, you will always attract people's attention. The bags will emphasize your personal style and taste.<br/>
xujie333
2012-5-21 14:36
coach outlet online Store guarantee that all the coach handbags offered are own high quality. In addition , all of them are sold at an unexpected low price.If you want to purchase, just visit their website.coach factory outlet is really sizzling kinds of shopping way for you. With the usage of the replica designer coach bags, you can surely be able to change your individual looks in a stunning manner.Coach bags on sale from the coach outlet are cheap or discount prices that you certainly will stand out from the crowd on your next camping trip!<br/>
看看淘宝是怎么赚钱 Homepage
2012-5-24 10:19
看看淘宝是怎么赚钱的:http://www.369in.com赚到你的每一个一千万。http://www.369in.com
virginiag Email Homepage
2012-7-26 10:02
Popular The North Face Jackets with the low price sale on online. If you want to buy the jackets that The North Face Outlet has discount for you. And we have other series for customers. http://www.northfaceoutletchicago.com/
fake oakleys Email Homepage
2012-7-26 15:47
fake oakleys start with sculptural physics and our unique three-point fit. fake oakley and see the vast array of performance treatments and lens tints that take the elements out of play. And rest assured: industry-best protection from the sun or flying objects.fake oakley sunglasses Get a clear view with High Definition Optics in fake oakley sunglasses for sale — wherever the world takes you.
分页: 2/3 第一页 上页 1 2 3 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]