Posts with the tag SQL

Change MySQL password on the terminal

Here is how change the root password of MySQL on Ubuntu or Debian:

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables
echo "use mysql; update user set password=PASSWORD('newpass') where User='root'; flush privileges;" | mysql -u root -p
## this doesn't work in 'skip-grant-tables' mode:
#echo "SET PASSWORD FOR 'root' = PASSWORD('newpass');" |...

Read on


search using SQL

SELECT * from bash_history where  command LIKE '%modprobe%'

% is the wildcard character in SQL!

SQlite specifics


Read on

Database abstraction with Python: SQLAlchemy

The SQLAlchemy SQL Toolkit and Object Relational Mapper is a comprehensive set of tools for working with databases and Python. It has several distinct areas of functionality which can be used individually or combined together. Its major API components, all public-facing, are illustrated below:

|    ...

Read on


Important Notes

Omitted SQL Language Features

SQLite Keywords
you cannot choose table names from the keywords list!!!

enforce foreign keys
SQLite Foreign Key Trigger Generator:

Jump Start

SQLite with Python

Admin tools / GUIs


Open Source, cross platform!

SQLite Database Browser

sudo apt-get install sqlitebrowser



Read on

Convert Certain Tags to Categories / Delete Certain Tags using SQL

ATTENTION! Do not follow this advice! It is of no use, now that I found the converter for Tags ↔ Categories: Categories to Tags Converter Importer!!!

Sometimes you give posts a tag but realize later it should rather be a category.

What you can do to convert a certain tag –...

Read on

Change the date of WordPress posts in an SQL Mass Update

When I programatically added most of the blog posts in this blog, I forgot to adjust the date and time of each post to its actual age. So I decided to set it via SQL directly in the database.

First I worked out a SELECT query to filter all the entries...

Read on