Ubuntu is one the most popular Linux distributions. Ubuntu is a free and open-source software based on Debian. In this simple I will walk you through the whole process to install a LEMP stack (Linux, Ngnix, MySQL/Maridb & PHP) which…
Tag: MySQL
Database rollback transactions in Laravel
In this post I will show you an example of database rollback in Laravel application. Rolling back database changes in your Laravel application is required when you have many db operations to run in the process of completing a particular…
How to create a user in MySQL/MariaDB and grant permissions on a specific database
To create a user in MySQL or MariaDB and granting it permissions to access a database is a basic task when deploying a new website on a LAMP stack server. To read and write data on a database is a very common…
How to enable MySQL slow query log and analyze it on Linux
MySQL slow query log is helpful when you needed to debug slow down or failure of your MySQL server. Slow query log can house queries which took more than n number of seconds.
MySQL ‘show tables’: How to list tables in a MySQL database?
This is very commonly asked question: How do I show or list all the tables in a MySQL (or MariaDB) database using mysql command line tool? In brief, to show the tables in a MySQL database, run the command:
How to Replace a Text String in a MySQL Table Field Value
In this simple tutorial you will learn to replace a text string in a MySQL table field value. I have a races table in which I store race event information. In the date field I store event date. Since these…
Database date between query build file in CodeIgnitor administrator
Here’s the path to DB file in CodeIgnitor admin end which contains query related stuff. Like building order, qhere and select blocks. One may want to do some debugging in this file. In this file i need to make no…
How to update a mysql table with the count of another table while using like statement
While working on a web links directory i wanted to update categories table’s num_listings column with the count of listings under each category. The category id was stored something like this in listings table:
A few notes on joining a MySQL table to itself to get unique combination of field data
Just a few notes on joining a MySQL table to itself to get unique combination of data stored in its fields. Suppose we have a MySQL table named `keywords` having fields `word1`, `word2` and `word3`. Once we have got a…
Fixing ‘mysql’ is not recognized as an internal or external command in Windows7
Having WAMP installed when i try to type mysql in my windows command prompt it would give me the following error: