phpMyAdmin is throwing a #2002 cannot log in to the mysql server phpmyadmin

If you’re getting the #2002 Cannot log in to the MySQL server error while logging in to phpmyadmin, try editing phpmyadmin/config.inc.php and change: $cfg[‘Servers’][$i][‘host’] = ‘localhost’; to: $cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’; Solution from Ryan’s blog Edit (20-Mar-2015): Note that if you’re on a fresh install, config.inc.php may not exist. You need to rename / copy config.sample.inc.php … Read more

Is there a simple way to convert MySQL data into Title Case?

Edit Eureka! Literally my first SQL function. No warranty offered. Back up your data before using. 🙂 First, define the following function: DROP FUNCTION IF EXISTS lowerword; SET GLOBAL log_bin_trust_function_creators=TRUE; DELIMITER | CREATE FUNCTION lowerword( str VARCHAR(128), word VARCHAR(5) ) RETURNS VARCHAR(128) DETERMINISTIC BEGIN DECLARE i INT DEFAULT 1; DECLARE loc INT; SET loc = … Read more

SQL query to prepend prefix to existing value in a field

You have no other conditions like update this in all rows then you can try UPDATE jos_content SET title = CONCAT(‘Mr. ‘, title) if you want to update conditionally that means particular row needs to update the you can use UPDATE jos_content SET title = CONCAT(‘Mr. ‘, title) where fiedl_name=”condition” eg: UPDATE jos_content SET title … Read more

Access to the requested object is only available from the local network phpmyadmin

If you see below error message, when try into phpyAdmin: New XAMPP security concept: Access to the requested directory is only available from the local network. This setting can be configured in the file “httpd-xampp.conf”. You can do next (for XAMPP, deployed on the UNIX-system): You can try change configuration for <Directory “/opt/lampp/phpmyadmin”> # vi … Read more