How to output psql to file

Filed in How-to | postgresql Leave a comment

FacebookTwitterGoogle+LinkedInTumblrShare

Application: PSQL
Operating System: Linux – Fedora Core 19 (Schrödinger’s Cat)
Architecture: x86_64

To write the psql to file.

, ,

How to enable timing and remove result pagination in psql

Filed in How-to | postgresql Leave a comment

Application: PSQL
Operating System: Linux – Fedora Core 19 (Schrödinger’s Cat)
Architecture: x86_64

To monitor execution time, set timing to on.
To remove result pagination (more), set pager to off.

, , , ,

How to create dump in MySQL

Filed in Fedora Core | mysql Leave a comment

Database: MySQL
Operating System: Linux – Fedora Core 19 (Schrödinger’s Cat)
Architecture: x86_64

Dump basically is a copy of the database in SQL file. It is useful as backup or to reconstruct similar database on different server. Replication normally will get a dump from master database and restore in slave database.

To create a dump.

Approach 1: SSH client, use mysqldump and download through FTP client.

Approach 2: Direct mysqldump from your machine.

By default, mysqldump have –opt options which include –add-drop-table, –add-locks, –create-options, –disable-keys, –extended-insert, –lock-tables, –quick, and –set-charset.

But by default, mysqldump does not include –events and –routines.
–triggers is included by default with each table.
–no-create-db is useful if you plan to load the dump under different database name.
–verbose will output to terminal.

For more information please refer to

, , , ,

How to restore dump in MySQL (nohup version)

Filed in Fedora Core | How-to | mysql Leave a comment

Database: MySQL
Operating System: Linux – Fedora Core 19 (Schrödinger’s Cat)
Architecture: x86_64

Normally, you will maintain remote database server through SSH client.
Large database dump require long time to restore (few hours).
Disconnect SSH client from remote database server will kill the running process.
Leaving the terminal open until restore the dump completed meaning leaving laptop overnight at office.
Nohup approach allow the process to continue running even if SSH client disconnect from remote server.

, , , ,

Installing PgModeler 0.5.2 on Fedora Core 19

Filed in Data Modeler | Fedora Core | How-to | postgresql 1 Comment

Application: PgModeler 0.5.2
Operating System: Linux – Fedora Core 19 (Schrödinger’s Cat)
Architecture: x86_64

Step 1
Download the package.

Step 2
Extract the archive package.

The application will be located at /home/user/Apps/pgmodeler

Step 3
In order to make it run, you need to setup required environment variables.

Step 4
Required library.

Step 5
Run application.

pgmodeler052

, , , ,

Installing PgModeler 0.5.0 on Fedora Core 18

Filed in Data Modeler | Fedora Core | How-to | postgresql Leave a comment

Application: PgModeler 0.5.0
Operating System: Linux – Fedora Core 18 (Spherical Cow)
Architecture: x86_64

Step 1
Download the package.

Step 2
Copy and extract the archive.

The application will be extracted to /opt/pgmodeler-0.5.0

Step 3
Inorder to make it run, you need to setup environment path.

Step 4
Execute the application.


pgmodeler

, , ,

Installing PostgreSQL 9.2.4 on Fedora Core 18

Filed in Fedora Core | How-to | postgresql Leave a comment

Application: PostgreSQL 9.2.4
Operating System: Linux – Fedora Core 18 (Spherical Cow)
Architecture: x86_64

Step 1
Clean and re-cache package list in repositories.

Step 2
Install PostgreSQL 9.2.4 and pgAdmin 3. The package is available in fedora update repository.

Note:
Package from Fedora Update repository will install to /usr/bin/
Package from Postgresql92 repository will install to /usr/pgsql-9.2/bin/

Step 3
Initialise DB

Output

Important

Step 4
Start Server

Step 5
Test the database server

Note:
To allow username and password mode, edit pg_hba.conf
To allow listening on all adaoters, edit postgresql.conf

, ,

How to add new user to MySQL

Filed in How-to | mysql Leave a comment

Database: MySQL

Open terminal. Connect to database using MySQL commandline client.

,

Installing Apache 2.4.4, PHP 5.4.15 and phpMyAdmin 4.0.1

Filed in Database | Fedora Core | How-to | mysql Leave a comment

Web Server: Apache 2.4.4
Intepreter: PHP 5.4.15
Application: phpMyAdmin 4.0.1
Operating System: Linux – Fedora Core 18

Step 1
Install MySQL 5.5.30.

Step 2
Install Apache 2.2.4.

Note

Step 3
Install PHP. php-5.4.15 available from Les RPM de Remi repository.

Note

Step 4
Installing phpMyAdmin 4.0.1.1.

Note

Step 5
If still cannot connect, it can be due to SELinux restriction.

, , ,

PostgreSQL Plus Advanced Server 9.2.1.3 on Fedora Core 18 – Part 1

Filed in Fedora Core | How-to | postgresql | Uncategorized Leave a comment

Application: PostgreSQL Plus Advanced Server 9.2.1.3
Operating System: Linux – Fedora Core 18
Architecture: x86_64

1. Download.
– Access to EnterpriseDB web site

– Register, login and download the file ppasmeta-9.2.1.3-linux-x64.tar.gz.
– Download path /home/user/Downloads/ppasmeta-9.2.1.3-linux-x64.tar.gz

2. Extract
– Open terminal.

– Extracted to /home/user/Downloads/ppasmeta-9.2.1.3-linux-x64

3. Install

Language Selection

License Agreement

User Authentication – Using EnterpriseDB account.

Installation directory – leave it as default

Components Selection

Additional Directories

Configuration Mode – Oracle Compatible

Password for enterprisedb user

Additional Configuration – Port. Locale and Sample

Server Utilization

Workload Profile

PgBouncer Configuration

Service Configuration

Summary

Installation Confirmation

Installation Progress

4. Set up environment path

5. Access database using psql client

, ,

TOP