Snippets Collections
# If your logged in to mysql (mysql -u root -p) you can create the database
CREATE DATABASE database_name;

# The user can be created with
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'user_password';

# This user also needs access to the database
GRANT ALL PRIVILEGES ON database_name.* TO 'database_user'@'localhost';

# To make the new access rights available you have to reload them

WPDBNAME=`cat wp-config.php | grep DB_NAME | cut -d \' -f 4`
WPDBUSER=`cat wp-config.php | grep DB_USER | cut -d \' -f 4`
WPDBPASS=`cat wp-config.php | grep DB_PASSWORD | cut -d \' -f 4`
Db::getInstance()->executeS("DELETE FROM product_images WHERE id_product NOT IN (" . join($allProductIds,',') . ")")

Fri Jun 11 2021 14:23:59 GMT+0000 (UTC)

#database #mysql

Mon Jun 07 2021 18:06:54 GMT+0000 (UTC)

#wordpress #database #credentials #automate

Thu Aug 06 2020 13:55:46 GMT+0000 (UTC)

#sql #database #querying-data

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension