如何修改MySQL的后台管理的网址

URL for phpMyAdmin
phpMyAdmin is a good tool for administration of MySQL databases, but the URL is not secure by default

很多站长都使用MySQL来作为网站的主要数据库系统,而phpMyAdmin又是相当好用的数据库后台管理界面。但是,他的默认网址URL一般如上图:http://你的网址/phpMyAdmin,这么简单就可以猜到的网址,很容易让黑客进入你的后台数据库里面。

如何让管理平台可以更安全呢?试试下面的简单方法:

    1. 先找到phpMyAdmin的这个文件apache.conf,在Linux环境下,通常在/etc/phpmyadmin/这个位子,找到后打开文件,通常在最顶端可以找到下面这段叙述:
      # phpMyAdmin default Apache configuration 
      Alias /phpmyadmin /usr/share/phpmyadmin
    2. 接着,就将这段叙述“Alias /phpadmin /usr/share/phpmyadmin”,修改为下面的方式:
      Alias /secretcode /usr/share/phpmyadmin,这个secretcode自己编一个任何人都很难猜得出来的文字代号,例如‘@34%6tFd&hs‘
      如下:

      # phpMyAdmin default Apache configuration 
      Alias /@34%6tFd&hs /usr/share/phpmyadmin
    3. 重新启动你服务器上的apache
      sudo /etc/init.d/apache2 restart
    4. 在试着用你的浏览器去看看:http://www.你的网址/@34%6tFd&hs ,就可以管理你的MySQL数据库了

     

      發佈留言