How to change a database table prefix in PhpMyAdmin?

Here, to Change the database table prefix from previous to new one, OR add table_prefix to the tables.

How to change e database table prefix:

  1. First Log In to PhpMyAdmin.
  2. Now, Select the Database want to change.
  3. Click on the Structure and here all tables are listed.
  4. Now, in the bottom position, mark check all or Select the tables want to update or modify.
  5. A Modal will Pop Up, here fill the fields.
  6. In Modal: From : Enter Old table prefix
  7. In Modal: To: Enter new table prefix
  8. In Modal: Click Continue.
  9. Now all done. Check your tables.

How to Increase or Decrease the price of all products in the table using SQL.

Here, the main focus is to update the field (here PRICE field ) value by adding some number or subtracting a number or adding a percentage amount directly in the TABLE using SQL command.

Note: When You are Going to Execute this command, I prefer you to keep a backup of your data. Sometimes after Executing a wrong command by mistake, as a effect may be your whole data be lost or that particular FIELD’s data be lost.

Here, TABLE NAME = ‘product’ and TABLE FIELD = ‘price’

# Update the price by 10% of the price for product=1

UPDATE `product` SET `price` = ROUND(`price` * (0.1), 0) WHERE `id` =1
# Update the price by Adding 10% of the price for product=1.
# New price will be, Price = price + (price * 10%)

UPDATE `product` SET `price` = `price` + ROUND(`price` * (0.1), 0) WHERE `product_id` =1
# Update the price by decreasing the existing price by 10% for product id=1.

UPDATE `product` SET `price` = (`price` - ROUND(`price` * (0.1), 0)) WHERE `product_id` =1

If you have any Query regarding this or have any Suggestion, please comment below.

Disable ONLY_FULL_GROUP_BY

Disable ONLY_FULL_GROUP_BY

 

Solution 1: Remove ONLY_FULL_GROUP_BY from mysql console

mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Solution 2: Remove ONLY_FULL_GROUP_BY from phpmyadmin

– Open phpmyadmin & select localhost

– Click on menu Variables & scroll down for sql mode

– Click on edit button to change the values & remove ONLY_FULL_GROUP_BY & click on save

 

 

 

 

To keep your current mysql settings and

disable ONLY_FULL_GROUP_BY

I suggest to visit your phpmyadmin or whatever client you are using and type:

SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')  copy_me

 

next copy result to your my.ini file.

For mint:

sudo nano /etc/mysql/my.cnf

For ubuntu 16 and up:

sudo nano /etc/mysql/my.cnf

For ubuntu 14-16:

/etc/mysql/mysql.conf.d/mysqld.cnf