Web development tutorials.

  • Read and Parse JSON files in PHP

    Read and Parse JSON files in PHP

    Read and parse JSON files using the functions file_get_contents() and json_decode() in PHP. The function file_get_contents() will read the entire file into a string, while json_decode() will decode the JSON string. Requirements: PHP PHP JSON extension – added and enabled by default since PHP 5.2.0 How To Read and Parse JSON Files in PHP. The…

    Read more

  • Check Apache, MySql, and PHP versions

    Check Apache, MySql, and PHP versions

    To further check Linux Apache MySQL PHP (LAMP) stack installation, the following can be made to know the exact installed version of each application. Check Apache version. To check the Apache HTTP Server version, type httpd -v on the command line. $ httpd -v Apache’s version is 2.4.55. Check PHP version. To check the PHP…

    Read more

  • Restore MySQL backup from the terminal

    Restore MySQL backup from the terminal

    Efficiently import MySql backup database records from an .sql file using the mysql command from the terminal. A quick and direct approach to restore MySQL backup files from the terminal. For example. mysql -uNAME -p DATABASE < database_backup.sql Enter the PASSWORD when prompted. Enter password: Where. NAME is the user who has access to the…

    Read more

  • Grant Privileges to MySQL User

    Grant Privileges to MySQL User

    Assign privileges and roles to MySQL user accounts and roles using MySQL GRANT statement. This is to be able for a MySQL user to perform MySQL basic operations such as add, edit, delete, and select records from a MySQL Database, a permission should be granted to authorize access to a MySQL Database to perform the…

    Read more

  • Create MySQL Database User

    Create MySQL Database User

    Create a MySQL user with password to access a MySQL database from a specific host to do things like adding, updating, deleting, and listing database records. Requirements: MySQL MySQL User with Password MySQL Host How To Create A MySQL User From The Terminal. Access the MySQL database first, and execute the code below once login…

    Read more

  • Access MySQL Database From Terminal

    Access MySQL Database From Terminal

    Directly access a MySQL database from the terminal. Connect with the given username, password, and host straight from the command line. Know more about the common errors when connecting to MySQL database. Requirements: MySQL MySQL User with Password MySQL Host How To Connect To MySQL Database From The Command Line Terminal. Step 1. Open a…

    Read more