HostOnNet Blog

Category Archives: Database

Create User and Database in PostgreSQL

PostgreSQL default user name is postgres. This is a system user, so to login, first change to this user with command Now you can connect to PostgreSQL by simply running psql Now you have full rights to PostgreSQL installation. Create


PostgreSQL DESCRIBE TABLE

DESCRIBE TABLE is a command used in Oracle database to show structure of a table in database. The PostgreSQL equivalent is \d+ TABLE_NAME You will need to see database structure to work with databases. Example


Restore PostgreSQL Database

To restore Database in PostgreSQL, run pg_restore -h POSTGRESQL_SERVER_IP -p 5432 -U POSTGRESQL_USERNAME -d POSTGRESQL_DB_NAME -v backup.dump -p = specify port used by PostgreSQL server. -d = Connect to database and restore directly into the database. -v = Specifies verbose


How to deactivate WordPress Plugins using PHPMyAdmin

We can deactivate a plugin through WP Admin Dashboard. What we can do if we can’t accessing the admin area ? Yes, The following situations may block you out from accessing the dashboard 1). Will show a blank page after


PostgreSQL – Quick Start Guide

After you install PostgreSQL on Ubuntu/Debian, it will create a user “postgres”, it have full privileges. It is like “root” user in MySQL. Connect to PostgreSQL To connect to PostgreSQL, run following command. This will change current user to linux


How to Check PostgreSQL is installed or not on Linux

PostgreSQL is a popular database management system that is used to handle the data of many websites and applications. If you were to run which psql and Postgres is not installed there appears to be no output. You just get


MySQL access from command line on Ubuntu

First connect to your Ubuntu server using ssh and run below command It will give you a password prompt as follow: Enter root password there and press enter key, then it will be connected successfully. It will show below output: To


Securing MySQL database on Cpanel Servers

After you setup Cpanel, you have to do few things to secure MySQL on Cpanel server. 1. Delete the test database This can be done with command mysqladmin drop test 2. Change MySQL root Password This can be done through


Cpanel phpMyAdmin shows “test” database

On Cpanel Server, test database shows on all users phpMyAdmin. This create problem as some new users create their tables on this “test” database and some other users delete these tables. To correct this problem, just delete this default database


MySQL Query Cache

The query cache stores the text of a SELECT query together with the corresponding result that was sent to the client. If an identical query is received later, the server retrieves the results from the query cache rather than parsing