Tag: mysql

Drop all databases from mysql

Sometimes I need to clean a mysql server so I can re-import it clean from the backups. A DROP ALL DATABASES; would have been nice, but the following does the trick. It will drop all databases except for mysql, test…

MariaDB vs MySQL short benchmark

Considering switching from MySQL to MariaDB? Me too. I wanted to see if I can look towards any performance improvements (or drops). I don’t have high level needs, I’m sure more comprehensive tests exist. This is simple run-all-tests.pl from sql-bench…

Mysql authentication issues

Ever happened to you that you create a user with privileges to connect from any host but it won’t connect from the localhost? Like this: [root@18969_1_490528 tmp]# mysql -u test_user -puser_pass ERROR 1045 (28000): Access denied for user ‘test_user’@’localhost’ (using…

MYSQL: set first letter of field to uppercase

I recently had to set values of a set of values from a column from lowercase to Firstuppercase. Nothing easier, run the following code on the database: UPDATE `affected_table` SET `field_in_question` = CONCAT(UPPER(LEFT(`field_in_question`, 1)), SUBSTRING(`field_in_question`, 2));