We are using MariaDB on an Ubuntu server powered by Webmin and Virtualmin. The MariaDB server has been installed after removing the default MySQL installation that comes with Virtualmin.
This is a very simple example on how to use SlimPHP and PDO in a basic API that updates, lists and deletes entries from a table. If you are new to building APIs with SlimPHP, then this is a good…
Commands: sudo nano Look for [mysqld] and bind-address Edit the new address that matches your desired ip address (0.0.0.0 for all) sudo service mysql restart mysql –uremoteuser -premoteuserpassword GRANT ALL ON *.* TO remoteuser@’%’ IDENTIFIED BY ‘remoteuserpassword’; FLUSH PRIVILEGES;…
A great tutorial to do so can be found here: Please remember to prefix the commands with sudo or use an elevated privileges user. A nice touch not found in other tutorials is the recommendation to install APCu PHP…
Use the following commands to change the URL of a WordPress website directly inside the mysql database: UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, '','');…
Reset the term count: UPDATE wp_term_taxonomy tt SET count = (SELECT count(p.ID) FROM wp_term_relationships tr LEFT JOIN wp_posts p ON (p.ID = tr.object_id AND p.post_type = 'post' AND p.post_status = 'publish') WHERE tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.taxonomy = 'tag';
To delete the media files without leaving traces in the database, do the following: Connect to the mysql database – using phpmyadmin, for example – and run the following queries: DELETE FROM wp_postmeta WHERE post_id IN ( SELECT id FROM…
Use the following code in your script to set the internal php encoding to UTF-8: /* Set internal character encoding to UTF-8 */ mb_internal_encoding("UTF-8"); mb_http_output( "UTF-8" ); ob_start("mb_output_handler"); Also, for mysql and postgres you should take into consideration the following…