For some reason, MySQL/MariaDB stopped giving access to the root user. Uninstalled and reinstalled with Homebrew. Fresh install, fresh tables but when you enter mysql -u root -p You get this error: Access denied for user ‘root’@’localhost’ (using password: NO). You reinstalled MySQL/MariaDB many times but it is still asking for a password. Here is Full Article…
MySQL – Remove all triggers by using the SQL queries
Sometimes you want to remove all existing triggers in your database so that you can create the new one. You can execute the following SQL query to generate all necessary SQL queries to remove the triggers in your database. SELECT Concat(‘DROP TRIGGER ‘, Trigger_Name, ‘;’) FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA = ‘your_database_name’; After that, you can Full Article…
Mysql – Grant a user permission to only show a view
Here are some SQL queries that you need to execute to grant the permission for existing user to a specific view. The first command: GRANT SELECT ON <database_name>.<view_name> TO <user>@<host> The second command: GRANT SHOW VIEW ON <database_name>.<view_name> TO <user>@<host>
Mysql – Too many connections
If you see the error "… To many connections…" while you are accessing your website, you can do the following ways: 1. In your mysql my must to run this: Set Global max_connections=2000 I'm using phpMyAdmin and I executed 2. In your my.conf file (usually located in /etc) find the line that says: [mysqld] And somewhere Full Article…
Create a Cron Job to start MySQL if it Stops
Sometimes server act weird and stop some services due to any issue. I faced this issue with my CSSJockey.net WordPress demo sites server, where MySQL service stops after running the clean script to remove demo demo sites after three days. So I created a Cron Job on my DigitalOcean Ubuntu Droplet to check if and start MySQL service if its Full Article…
MySql – Concatenate many rows into a single text string
I had an issue when I was trying to join two tables with one-to-many relationships. If there is a table called STUDENTS SubjectID StudentName ———- ————- 1 Mary 1 John 1 Sam 2 Alaina 2 Edward Result I expected was: SubjectID StudentName ———- ————- 1 Mary, John, Sam 2 Alaina, Edward * Solution: In Full Article…
Magento – Truncate Magento sales_flat_quote* tables
Recently, we have run into a few stores where the sales quote tables have grown beyond all proportion and resulted in the store grinding to a halt. The worst that we have seen so far is a Magento Enterprise installation that had 17 million entries, consuming a huge amount of space and locking dozens of Full Article…
Magento – COPY PRODUCT DATA FROM ONE MAGENTO STORE VIEW TO ANOTHER
I found recently that adding a new store view to Magento was a pretty straightforward task, however I needed all products on the new store view to be the same as another. All new store-view catalog data inherits from the default store scope instead of a sibling store-view’s data. Copying this content from one store Full Article…
Magento – “Item (Mage_Catalog_Model_Product) with the same id ”xxx“ already exist”
I have been getting this error when trying to filter a products collection Item (Mage_Catalog_Model_Product) with the same id "7631" already exist and wanted to ask what could ne causing the error since there is only one (visible) product with the same ID inside of Magento. ———————————————————– Here is the solution i did to solve the Full Article…
Magento – Change Product Type
Suppose you have created or Imported products into the Magento and now you want to change the products type like you have imported the products with the product type Downloadable and now you want this products from Downloadable to Simple then In the Magento admin there is no way to change the product type. If Full Article…