DevArticles.In
  • Home
  • Hindi to Unicode
  • PHP Debug
  • CakePHP Captcha
  • How-To
  • About
  • Contact

Category: MySQL

How to create a user in MySQL/MariaDB and grant permissions on a specific database

September 11, 2021September 11, 2021 Arvind KumarMySQLLeave a Comment on How to create a user in MySQL/MariaDB and grant permissions on a specific database
mysql-logo

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…

Read More→

How to enable MySQL slow query log and analyze it on Linux

December 30, 2019December 30, 2019 Arvind KumarMySQLLeave a Comment on How to enable MySQL slow query log and analyze it on Linux
mysql-logo

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.

Export, Import MySQL db between different servers through Linux command line

August 7, 2019August 7, 2019 Arvind KumarLinux/Unix, MySQLLeave a Comment on Export, Import MySQL db between different servers through Linux command line
mysql-logo

You should have Database name, Database Username, Database Password and command line access to your server Export database to local file system, for example /var/www/html

MYSQL – Useful commands you must know – Part-1

May 21, 2019May 21, 2019 Arvind KumarMySQLLeave a Comment on MYSQL – Useful commands you must know – Part-1

To know the current MYSQL version: SELECT version(); To format and formulate a float value: FORMAT(SUM(amount) * 0.6, 2) The above line sums up entire amount value, cut it down to 60% of total value and returns value precised up…

Read More→

MySQL ‘show tables’: How to list tables in a MySQL database?

February 21, 2019February 21, 2019 Arvind KumarMySQLLeave a Comment on MySQL ‘show tables’: How to list tables in a MySQL database?
mysql-logo

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 search replace string text in a table field in mysql

January 30, 2019January 30, 2019 Arvind KumarMySQLLeave a Comment on How to search replace string text in a table field in mysql

I have a date field in my mysql database table. I want to replace year 2017 in this field to 2019 Following command would do this. UPDATE races SET `date` =REPLACE( `date` , ‘2018’, ‘2019’ ) WHERE INSTR( `date` , ‘2018’ ) >0 Just saving it for reference here.

Updating two columns with a subquery in MySQL

August 17, 2014August 17, 2014 Arvind KumarMySQLLeave a Comment on Updating two columns with a subquery in MySQL
mysql-logo

Sometimes you wanted to update columns of one MySQL table by quering another MySQL table and getting a column value from the later table. For example you have a ‘students’ table and you wanted to create a new field ‘totalMarks’…

Read More→

To print the table structure of MySQL table in PHP

April 28, 2014February 19, 2020 Arvind KumarMySQL, PHPLeave a Comment on To print the table structure of MySQL table in PHP
A simple way to debug a php application in production mode

You can print the table structure of MySQL table in PHP using simple php script. All you need to do is to make a ‘describe table’ call and process it using php script, similar to one you use to print…

Read More→

Changing database character set

December 19, 2013December 20, 2013 Arvind KumarMySQL, WordPressLeave a Comment on Changing database character set
mysql-logo

Why to consider changing database character set? Why do i need to do this? As to find a more straight answer please look at the image below, taken from one of my websites built in WordPress:

How to delete duplicate MySQL records with duplicate field value (as ID)

February 20, 2012September 19, 2014 Arvind KumarMySQL, WordPressLeave a Comment on How to delete duplicate MySQL records with duplicate field value (as ID)

For some reason i had duplicate entries in my WP database. The ID field in wp_users table was tempered with and was changed to Non Auto-Increment to insert records on the will. I deleted all ID=null records manually and then…

Read More→

Posts navigation

1 2 Next

Recent Posts

  • Database rollback transactions in Laravel
  • Automatic Deployment of your Git Push to Remote Server
  • CSV Content Validation with FormRequest Rules in Laravel
  • Using Unique Validation Rule in Form Request in Laravel
  • React Table Server Side Pagination with Sorting and Search Filters
Copyright © All rights reserved.
Blog Kit by WP Charms