Heim > Datenbank > MySQL-Tutorial > Ubuntu phpMyAdmin and Multiple Servers_MySQL

Ubuntu phpMyAdmin and Multiple Servers_MySQL

WBOY
Freigeben: 2016-06-01 13:16:43
Original
1042 Leute haben es durchsucht

UbuntuServerUbuntu

I've been playing around with Ubuntu 14.04 since it came out a few weeks (days?) ago. One thing I needed was to be able to use phpMyAdmin to access multiple development MySQL servers. Since I haven't found very good documentation on this, I wanted to post it here so that it hopefully helps others.

Note that I won't help with MySQL privileges here. I'll assume you just want the same setup as I have: 1 LAMP server, several MySQL servers with remote root access. You'll have to verify that you can actually access the MySQL servers remotely as root.

Install phpMyAdmin

So first, install phpMyAdmin:

sudo apt-get updatesudo apt-get install phpmyadmin
Nach dem Login kopieren

It'll ask you a bunch of questions. Since the MySQL servers are remote, just say "No" to any database question. For the web server question, choose the one you used (most probably Apache).

Copy and Configure

Next, just copy the sample configuration Ubuntu includes for multiple hosts:

sudo cp /usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php /etc/phpmyadmin/conf.d
Nach dem Login kopieren

That will copy the file into /etc/phpmyadmin/conf.d/ which I assume won't be blown away by an Ubuntu phpMyAdmin update. Then edit the file and change the $hosts array to whatever your servers' hostnames or IP addresses are.

$hosts = array ("db01.example.com","db02.example.com",
Nach dem Login kopieren

);

These will be listed in a dropdown box below the Username/Password fields.

That's it! Since I setup my development MySQL servers without a root password, I added the following before the last brace:

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
Nach dem Login kopieren

You should follow me onTwitter.

Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage