Archive

Posts Tagged ‘MySQL’

MySQL Transpose Row Into Column

Image representing MySQL as depicted in CrunchBase

Image via CrunchBase

This article explain how to transpose a MySQL table from row to column. Suppose that you have a sales table per item per retail outlet per sales date like this:

Original Sales Table

Then, you need to show the total sales per item per retail outlet like the following:

Read more…

  • Share/Bookmark
Categories: MySQL Tags: , ,

MySQL Backup to Email

Image representing MySQL as depicted in CrunchBase

Image via CrunchBase

This simple PHP script can be used to backup MySQL databases and then send the zipped backup file to email addresses. The backup file can then be restored by any MySQL front end program like the mysql command line, Navicat MySQL, or phpMyAdmin.

The logic of the script is really simple:

  1. initialization
  2. create backup sql file
  3. zip the file
  4. send email

Read more…

  • Share/Bookmark
Categories: Linux, MySQL, PHP, Windows Tags: , ,

Restore MySQL database, stored procedure missing ?

Backing up and Restoring mysql database could be done through several ways. You can backup and restore by exporting SQL script using MySQL command line or copying MySQL data directory from the original server to the destination server.

Using the second method will cause the stored procedure and function missing. In this article we will discuss how to overcome the situation.

Read more…

  • Share/Bookmark

Portable Apache, MySQL, PHP

Pada kondisi dimana user minta bisa mencoba aplikasi yang kita bangun menggunakan WAMP (Windows Apache MySQL PHP) dan belum terdapat server komputer yang dapat kita installkan infrastruktur yang dibutuhkan, kita dapat menggunakan portable WAMP yang dapat dijalankan dari USB.

Kondisi lainnya adalah ketika kita ingin membuat versi trial aplikasi web kita ke calon customer.

Salah satu yang dapat digunakan adalah USB Webserver (http://www.usberbserver.nl).  Aplikasi ini berisi Apache, PHP, dan MySQL yang telah dikonfigurasi dan siap dijalankan sehingga kita tinggal mengisi aplikasi web yang akan kita demokan ke client.

Read more…

  • Share/Bookmark

CodeIgniter: koneksi ke port MySQL tertentu selain 3306

Secara default, database driver MySQL CodeIgniter konek ke port default MySQL yaitu 3306. Pada kondisi dimana port MySQL bukan 3306 misalnya 3307, CodeIgniter tidak punya option untuk menentukan pada port berapa MySQL berjalan.

Solusi untuk hal ini dapat dilakukan dengan beberapa cara:

  1. mengedit file driver database CodeIgniter: system/database/drivers/mysqli/mysqli_driver.php. Pada file ini dapat ditentukan port MySQL pada function ‘db_connect’ yaitu dengan menambahkan parameter $port pada function tsb:
    mysqli_connect
    ( [string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket]]]]]] )
  2. mengedit file PHP.INI, pada bagian  mysql.default_port, ganti dari 3306 menjadi 3307
  3. jika tidak punya akses ke file PHP.INI, bisa juga dicoba dengan mengedit file config/database.php nya CodeIgniter yaitu pada baris:
    $db['default']['hostname'] = "mysqlhost.yourdomain.com:3307";
  • Share/Bookmark

MySQL Backup with phpMyBackupPro

phpMyBackupPro is a tool created using PHP programming language that can be used to perform backup and restore on MySQL database server. In this article we are going to learn how to install and configure this tool, perform manual backup and then perform restore the previously backed up database. We will also learn how to setup an automatic periodic backup using the same tool.

Installation

Installation of this tool is simple. Just download the newest version from http://www.phpmybackuppro.net/download.php.

After downloading, extract the zip file to a directory on your PHP and Apache web server accessible from browser, ie the Document Root, for example C:\XAMPP\HTDOCS. Then you will get a new folder under it, for example C:\XAMPP\HTDOCS\phpMyBackupPro.

That’s it! Now go to your web browser and point the URL of phpMyBackupPro, for example http://localhost/phpMyBackupPro.

Read more…

  • Share/Bookmark

Ikutilah Seminar GPS! "MEMBONGKAR RAHASIA BISNIS GPS TRACKING" - Pembicara : Ir. Akhmad Daniel Sembiring (CEO Vitraining.com & GpsTrackingIndonesia.com) - Bandung, Sabtu 25 September 2010 - Hotel Arion Swiss - Belhotel, Jl. Otto Iskandardinata No. 16 Bandung - Biaya Pendaftaran : 2 Jt (sebelum 18 September 2010 HANYA 1 Jt) - Register ONLINE : seminar-gps.vitraining.com - More Info e-mail to : info@gpstrackingindonesia.com

This site uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.6.0.