Managing the Database of Amimoto

Enabling phpMyAdmin

When you would like to use phpMyAdmin on Amimoto AMI for managing the database, you need to modify default.conf or example.com.conf at /etc/nginx/conf.d/.
(This is the case for AMI self-hosting which you create an instance of Amimoto with EC2 by yourself. If you use the managed hosting plan, it is already provided.)

.conf files are usually owned by root, so switch to the root user by "su -" before editing.

You will find the below line around L.61:

##include /etc/nginx/phpmyadmin;
location ~* /(phpmyadmin|myadmin|pma) {
    access_log off;
    log_not_found off;
    return 404;
}

Change the lines as below:

include /etc/nginx/phpmyadmin;
#location ~* /(phpmyadmin|myadmin|pma) {
# access_log off;
# log_not_found off;
# return 404;
#}

After editing, run # service nginx restart to restart Nginx.
Then you can access to phpMyAdmin with http://example.com/phpMyAdmin/.

                                                   

The login user and password of phpMyAdmin are the same to the database's one in wp-config.php. 

You can enable phpMyAdmin to follow the steps below.
After using phpMyAdmin, it is better to disable phpMyAdmin.
In phpMyAdmin, many vulnerabilities has been found before, so even it is not installed, many fraudulent accesses have been tried.
That's why Amimoto has phpMyAdmin installed but disabled it.

Managing Database with WP-CLI

Command line interface for WordPress - WP-CLI

You can manage your database with WP-CLI.
*WP-CLI is installed after Amimoto Ver.1.1.

Here are some commands to manage your database.

Usually mysql command and phpMyAdmin need the database name and the password to manage a database, WP-CLI uses those information in wp-config.php, so you don't need them.

Exporting Database

http://wp-cli.org/commands/db/export/

wp db export [<file>]

You can give any name +.sql to the file name.
After that, an sql is created.

Importing Database

http://wp-cli.org/commands/db/import/

wp db import [<file>]

You should upload an sql file to your server.

Replace Strings in Database

http://wp-cli.org/commands/search-replace/

For example, you wish to move your WordPress site to another server and change the URL from http://example.com to http://example.jp.

wp search-replace <old> <new>

Serialized strings also replaces rightly.
With --dry-run option, you can see the result without executing the actual replacement.

Resetting password (in case the mail address is wrong)

http://wp-cli.org/commands/user/update/

wp user update <user> --user_pass=marypass

<user> is the login name or mail address or user ID.
--user_pass option is the new password.

Optimizing database

http://wp-cli.org/commands/db/optimize/

wp db optimize

There are other commands for database so please see the official document for more details>
http://wp-cli.org/commands/db/

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk