INSERT (the Inside Security Rescue Toolkit) aims
to be a multi-functional, multi-purpose disaster
recovery and network analysis system. It boots
from a credit card-sized CD-ROM and is basically a
stripped-down version of Knoppix.
A couple of days ago I was adding entries to my ban related tables via phpbb's administration tools. After awhile, I quickly tired of serially adding an entry and then submitting it. I decided to dump the three tables in question and then modify them by hand. Plus that, I wanted to review the MySQL syntax.
Here are a series of create and insert statements for MySQL. I modified some of the entry values with "x", "!", "?" as to not offend some readers.
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Table structure for table `phpbb_banlist` --
Lately, I have been adding several user accounts to the mysql database. Since I have seen several queries via my metadata provider to create user accounts in MySQL, I have decided to add a post about it. There are three different methods that can be used to create user accounts and they are fairly straightforward.
mysql> use mysql; Database changed
Method 1: (create user, password - no privileges) mysql> CREATE USER 'esoft'@'localhost' IDENTIFIED BY '12wer56hi'; Query OK, 0 rows affected (0.16 sec)
--grant certain privileges mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON *.* TO 'esoft'@'localhost'; Query OK, 0 rows affected (0.00 sec)
--grant all privileges mysql> GRANT ALL ON *.* TO 'esoft'@'localhost'; Query OK, 0 rows affected (0.00 sec)
Method 2: (create user/password and grant all privileges at one fell swoop) mysql> GRANT ALL ON *.* TO 'topblog'@'localhost' IDENTIFIED BY 'topblog123'; Query OK, 0 rows affected (0.00 sec)
Method 3: (Insert user, password and privileges in table) mysql> INSERT INTO user (Host,User,Password) -> VALUES('localhost','freeads',PASSWORD('adlists123')); Query OK, 1 row affected, 3 warnings (0.01 sec)
mysql> INSERT INTO user (Host,User,Password,Select_priv,Insert_priv) -> VALUES('localhost','softhub',PASSWORD('softhub126'),'Y','Y'); Query OK, 1 row affected, 3 warnings (0.00 sec)
mysql> INSERT INTO user (Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv, -> Create_priv,Drop_priv) -> VALUES('localhost','freebies',PASSWORD('afreeb456'), 'Y','Y','Y','Y','Y','Y'); Query OK, 1 row affected, 3 warnings (0.00 sec)