All posts tagged “sql

comment 0

SQL Cheat Sheet

You can get the latest version of this SQL cheat sheet here: https://gist.github.com/janikvonrotz/6e27788f662fcdbba3fb

SQL languages

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.
Read More

comment 0

Create WordPress admin user with sql only

If you don’t have access to you WordPress website anymore, but still can update the MySQL database. You can easily add a new admin user with this sql script:

USE <database>;
 
SET @username = '<username>';
SET @password = MD5('<password>');
SET @fullname = '<Firstname Lastname>';
SET @email = '<login@example.com>';
SET @url = '<http://example.com/>';
 
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_status`, `display_name`) VALUES (@username, @password, @fullname, @email, @url, NOW(), '0', @fullname);
 
SET @userid = LAST_INSERT_ID();
INSERT INTO `wp_usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES (@userid, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES (@userid, 'wp_user_level', '10');

Get the latest version of this snippet here: https://gist.github.com/25d9f243fc20532cb1b5

comment 0

Install SharePoint 2013 Three-tier Farm – Deploy the SQL Server Backup Job

This post of is part of my Install SharePoint 2013 Three-tier Farm project.

A clean SQL Server maintenance plan should include three processes, backup, integrity check and index optimize.

You could simply set up a SQL Server maintenance plan within the SQL Server management studio. But be aware that there are better solutions, E.g. Ola Hallengren’s SQL Server Maintenance Solution is my absolutely favourite.

Read More