Phpmyadmin does support PHP 7 and Mysql 5.7.
I recommend you to grab latest release from their download page.
Current download link is:
https://files.phpmyadmin.net/phpMyAdmin/4.6.4/phpMyAdmin-4.6.4-all-languages.tar.gz
Also, this is about on requirements (from their download page).
Current version compatible with PHP 5.5 to 7.0 and MySQL 5.5 and newer.
How to install:
Download PhpMyAdmin. You can do it using wget from your droplet.
- wget https://files.phpmyadmin.net/phpMyAdmin/4.6.4/phpMyAdmin-4.6.4-all-languages.tar.gz
You will need to unpack it by using tar command:
- tar xvf phpMyAdmin-4.6.4-all-languages.tar.gz
As you finished it, rename it to phpmydmin
and move to /usr/share/
.
- mv phpMyAdmin-4.6.4-all-languages.tar.gz /usr/share/phpmyadmin
You installed phpmyadmin in /usr/share/phpmyadmin
. Now it needs to be configured.
First install needed PHP dependencies - mcrypt and mbstring.
- sudo apt-get install php7.0-mcrypt php-mbstring php7.0-mbstring php-gettext
This command will install it on your droplet, but keep in mind, only install, you need to enable it afterwards. To enable it execute following commands:
- sudo phpenmod mcrypt
- sudo phpenmod mbstring
Now restart PHP-FPM to make changes in effect.
- sudo systemctl restart php7.0-fpm
As for nginx, making symbolic link from phpmyadmin to /var/www/html will finish it’s job making available to nginx.
- sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html
Now we need to change blowfish_secret
in PHPMyAdmin config.
blowfish_secret
is using to encrypt passwords in cookie. Recommended length is 32 chars.
First of all make config.inc.php
file by copying its sample:
- sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
Now open it with your favourite text editor (e.g. nano
).
- nano /usr/share/phpmyadmin/config.inc.php
Locate following line: $cfg['blowfish_secret'] = '';
Now enter your secret between ''
and save file.
Last step is creating phpmyadmin
database.
Go to http://droplet_ip/phpmyadmin
.
Login to phpmyadmin
.
You will see warning that phpmyadmin
database is missing. You will have link which will take you to page with option to create database. Follow it, click OK, and wait until it finishes.
After that you have working phpmyadmin
on NGINX and PHP7.0.
(Optional:) Enable Configuration Storage
By default, some of extra options such as change tracking, table linking, and bookmarking queries are disabled.
You need to enable it you should do following:
Open config.inc.php
with text editor.
- nano /usr/share/phpmyadmin/config.inc.php
Locate following lines:
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
Uncomment it by removing //
and set some username and password instead of pma (username) and pmapass (password). These are only placeholders.
Also be sure to uncomment following lines under Storage database and tables
by removing //
.
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
Now you need to create user for it. Go again to phpmyadmin
and go to SQL.
Execute following query:
GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';
This will create in same time create MySQL user and Grant needed privileges.
This is whole tutorial for seting up phpmyadmin
. It should be fully working now.
About alternatives I can recommend you MySQL Workbench or HeidiSQL.
Both is applications that you install on your own PC, you don’t install anything on droplet.
MySQL workbench works on Windows, Linux or OS X, while HeidiSQL works with Windows, but it can be run via wine
on Linux.
If you get any problem, comment, I or somebody other will try to help you :)
Hello my name is David Russell MY Database for InternetTop40.com keeps disconnecting or something I keep getting this is deprecated error……
Warning: mysqlirealconnect(): (HY000/2002): Connection refused in /var/www/html/wp-includes/wp-db.php on line 1531
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/html/wp-includes/wp-db.php on line 1562
Warning: mysql_connect(): Connection refused in /var/www/html/wp-includes/wp-db.php on line 1562
I have been online now going on 3 years almost 1 year on DigitalOcean and I need some help with this Please someone move my database onto nginx and/or redo the database or just help me “update php and everything” I need help!!! It said to comment and someone will help. you can contact me by text 502-762-5184 if you can get thru (I have ConsumerCellular not real reliable but very inexpensive) or email internettop40@gmail.com Thank you