`
topzhujia
  • 浏览: 57204 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

How to: Change Hostname

阅读更多

Environment:Ubuntu 10.04(Lucid)

改變需要理由,更改只需要方法。所以下面的話只是教你如何更改主機名。

首先,編輯/etc/hostname,把里面的主機名改為你現在想要的主機名。hostname文件就像它的名字一樣,里面只有一句話,更准確的說是一個詞,就是你現在的主機名。比如我的hostname現在是ubuntu,那么cat < /etc/hostname得到的只是ubuntu。我現在想把它改為MySQL-Server,把hostname中的ubuntu直接替換就是了。

然后,編輯/etc/hosts,把其中以前的hostname全部替換成現在的hostname。例如,我的old hostname是ubuntu。cat < /etc/hosts得到的內容如下:

127.0.0.1 localhost

127.0.1.1 ubuntu.localdomain ubuntu


# The following lines are desirable for IPv6 capable hosts

::1 localhost ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

現在要做的就是把里面的ubuntu全部替換成MySQL-Server。

最后,reboot。關于reboot,我也很無奈a。誰讓咱現在是菜鳥呢,只能先重啟了,以后再說吧。

分享到:
评论

相关推荐

    drupal 6.12

    For detailed information on how to configure a test server environment using a variety of operating systems and web servers, see "Local server setup" (http://drupal.org/node/157602) in the Drupal ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    If your header file includes other header files, any change to those files will cause any code that includes your header to be recompiled. Therefore, we prefer to minimize includes, particularly ...

    php.ini-development

    Output buffering is a mechanism for controlling how much output data ; (excluding headers and cookies) PHP should keep internally before pushing that ; data to the client. If your application's ...

    crtmpserver源码

    * Change the 127.0.0.1 to either the IP of your crtmpserver or simply use a hostname of your machine * Replace file-download with the actual filename of your sample you download. Remeber to omit the ....

    2009 达内Unix学习笔记

    集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...

    Visual C++ 编程资源大全(英文源码 网络)

    (42KB)&lt;END&gt;&lt;br&gt;24,nwset.zip Do you want to change a Host name, DHCP or static IP settings? (14KB)&lt;END&gt;&lt;br&gt;25,ipxcheck_demo.zip How to obtain IPX node addresses of network stations (62KB)&lt;END&gt;...

Global site tag (gtag.js) - Google Analytics