WebFaction
Community site: login faq
0
1

There's a great post on compiling a private MySQL installation here.

Now how can I properly install phpMyAdmin and link it to it? I don't seem to find a decent step-by-step on the web.

Some tips on creating, uploading and managing databases via SSH would be also welcome.

Thanks!

asked 25 Sep '12, 14:01

uresende
133
accept rate: 0%


To install phpMyAdmin:

  1. Create a new static/cgi/php application and connect it to a website.
  2. SSH into your server and run the following commands to download and extract PMA:
    cd ~
    wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.5.2.2/phpMyAdmin-3.5.2.2-english.tar.bz2?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Fdownloads.php&ts=1348609141&use_mirror=freefr"
    cd ~/webapps/name_of_app
    tar jxf ~/phpMyAdmin-3.5.2.2-english.tar.bz2 --strip 1
    mkdir config
    
  3. Go to http://url_of_the_site/setup/ in your browser.
  4. Click "New server".
  5. Enter a friendly name for the new server.
  6. Enter localhost as the server hostname.
  7. Enter your MySQL app's assigned port.
  8. Enter the full path to your MySQL app's socket.
  9. Check Use SSL if you're accessing the site via HTTPS.
  10. Select socket as the connection type.
  11. Click Save to save the server.
  12. Under Configuration file, click Save to save your config.
  13. Back in your SSH session, run the following commands:
    cd ~/webapps/name_of_app
    mv config/config.inc.php ./
    rm -rf config
    echo "deny from all" > setup/.htaccess

At that point, phpMyAdmin should be available at the site you created in the first step.

Database management at the command line is done with the normal MySQL command line utilities, using options to point them at your private MySQL. For example, to create a database named "my_db":

mysqladmin -S ~/webapps/ms/var/mysql.sock -u root -p create my_db

Your can run "mysqladmin --help" and "man mysqladmin" in a SSH session for more information, or consult the MySQL documentation.

Hope that helps!

permanent link

answered 25 Sep '12, 17:07

seanf
12.1k21736
accept rate: 37%

Sean, I should have mentioned that I run my private Nginx+PHP-FPM stack - sorry. I assume the steps are a bit different in this case, am I right?

Also, do I need to install a different PMA for every app served by my stack?

(25 Sep '12, 18:11) uresende

Sean, I should have mentioned that I run my private Nginx+PHP-FPM stack - sorry. I assume the steps are a bit different in this case, am I right?

Sure, if you want to run PMA on your custom stack, then you'd need to do it differently.

Also, do I need to install a different PMA for every app served by my stack?

Everything I know about configuring PMA, I learned earlier today when I wrote that answer. I guess that if you're running multiple MySQL instances, then you'd probably need a separate PMA for each of them, but I don't know for sure.

(25 Sep '12, 18:27) seanf

sorry about point 8 how I get it? ty

(13 Mar '13, 05:14) Dariongp

also I get "#1045 Cannot log in to the MySQL server"

any idea?

(13 Mar '13, 05:27) Dariongp

sorry about point 8 how I get it? ty

If you've installed a private MySQL instance via our control panel, the socket path is /home/<your_username>/webapps/<app_name>/var/mysql.sock

also I get "#1045 Cannot log in to the MySQL server"

any idea?

That could be caused by any number of problems in your PMA config. Check that you're using the correct port, socket, hostname, username, password, etc. If you're not sure, then please open a support ticket and we'll take a closer look.

(13 Mar '13, 17:52) seanf

I also had this problem. It was solved – with good advice from the Webfaction support team - after changing in the config.inc.php file the username to 'root' and the password to the one received in the extra info field from the MySQL private instance application. Also fill in the correct port and socket information. To clarify the info below: APPNAME is the name of the MySQL private instance application. Other info (port and password) is fake for safety reasons.

$cfg['Servers'][$i]['host'] = 'localhost';

$cfg['Servers'][$i]['port'] = 12345;

$cfg['Servers'][$i]['socket'] = '/home/USER/webapps/APPNAME/var/mysql.sock';

$cfg['Servers'][$i]['connect_type'] = 'socket';

$cfg['Servers'][$i]['extension'] = 'mysqli';

$cfg['Servers'][$i]['auth_type'] = 'cookie';

$cfg['Servers'][$i]['user'] = 'root';

$cfg['Servers'][$i]['password'] = 'SOMEPASS';

(sensitive information edited out)

permanent link

answered 04 Jul '13, 06:22

Eric Wassink
124
accept rate: 0%

edited 04 Jul '13, 06:57

valentini
2614

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×168
×47
×23

question asked: 25 Sep '12, 14:01

question was seen: 3,836 times

last updated: 04 Jul '13, 06:57

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM