• Home
  • Billiards
  • Classic ASP
  • Browse Blog
    • Halifax
    • Internet
    • Internet Marketing
    • Programming
    • SEO
    • sitemap
    • Skateboarding
    • technology
      • Automation
    • travel
    • Web Development
    • Web Hosting
    • Website Management
    • wedding
  • Subscribe via RSS

HTTP_X_EAC_REQUEST

December 30th, 2011  |  Published in sitemap

The HTTP_X_EAC_REQUEST is commonly found on requests made by the baidu spider.

HTTP_X_EAC_REQUEST – eac_curl.class.php; v0.7.2, (Mar 20, 2008); [www.KevinBurkholder.com]

eZooms Bot User Agent

December 30th, 2011  |  Published in sitemap

I am trying to find the group/entity/company behind the ezooms.bot (ezooms.bot@gmail.com)

User agents: Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)

Some IP:

220.181.108.79

If you know any more info on this spider/bot/crawler/probe, please post below.

SQL Full Outer Join Three Tables

December 6th, 2011  |  Published in Programming, Web Development

Here is some code to do a full outer join on three tables.

In the example, the three full outer joins are done on two columns , but it works just the same if you only have a single join column.


CREATE TABLE ZA (T CHAR(1), O CHAR(1))
CREATE TABLE ZB (T CHAR(1), O CHAR(1))
CREATE TABLE ZC (T CHAR(1), O CHAR(1))

INSERT INTO ZA (T, O) VALUES ('1', 'A')
INSERT INTO ZA (T, O) VALUES ('2', 'B')
INSERT INTO ZA (T, O) VALUES ('3', 'C')
INSERT INTO ZA (T, O) VALUES ('4', 'D')

INSERT INTO ZB (T, O) VALUES ('1', 'A')
INSERT INTO ZB (T, O) VALUES ('2', 'B')
INSERT INTO ZB (T, O) VALUES ('5', 'E')
INSERT INTO ZB (T, O) VALUES ('6', 'F')

INSERT INTO ZC (T, O) VALUES ('2', 'B')
INSERT INTO ZC (T, O) VALUES ('3', 'C')
INSERT INTO ZC (T, O) VALUES ('4', 'D')
INSERT INTO ZC (T, O) VALUES ('5', 'E')
INSERT INTO ZC (T, O) VALUES ('7', 'G')





SELECT 
	ISNULL(ISNULL(A.T, B.T), C.T),
	ISNULL(ISNULL(A.O, B.O), C.O)
	
FROM
	ZA A FULL OUTER JOIN 
	ZB B ON A.T = B.T AND A.O = B.O FULL OUTER JOIN 
	ZC C ON ISNULL(A.T, B.T) = C.T AND ISNULL(A.O, B.O) = C.O




DROP TABLE ZA
DROP TABLE ZB
DROP TABLE ZC

Classic ASP Data Caching for Performance

December 2nd, 2011  |  Published in Web Development

Here is an OLD article I had about data caching in classic asp using the application object. When it comes to application performance on your web servers, ever little bit counts.

Howto build a database caching system

Introduction
In this tutorial I will teach you how to build a simple database caching system to improve the load on your database. This tutorial is meant for anyone, including beginners and experts.

What is a caching system?
A caching system is something which stores frequently accessed data in a file or variable, and allows for quick retrieval. Caching systems can be built in different ways; there are very basic ones and very complex ones. For example, AspIt is running an extremely advanced caching system. In this tutorial I’ll show you how to make a basic caching system.

Let’s begin with the code
First create a new asp page called caching.asp. Then copy and paste the following code in it;

Dim objConn, strQuery

'// Get connection
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnectionString

'// Get recordset
Set objRS = Server.CreateObject("ADODB.RecordSet")
objRS.Open "SELECT userid, username FROM users", objConn

'// Loop through results
Do While Not objRS.EOF
Response.Write objRS("userid") & " - " & objRS("username") & "
"
objRS.MoveNext
Loop

'// Close recordset
objRS.Close

'// Clean up
Set objRS = Nothing
Set objConn = Nothing

If you don’t know what this does, it simply opens a connection first, then gets a list of records, and finally closes the recordset and connection.[size=1]Please note that there is a better way to get the results (GetRows).[/size]

Everytime someone visits this page the same thing happens over and over again, even though the data doesn’t change that much. It seems useless to keep re-doing this over and over again, no? That’s where a caching system kicks in. As I said earlier, it caches frequently used data, so it would be perfect for our page.

A good place to store cached data in is the Application object, because it can be accessed by anyone! If you store the cached data in the Session object, only one user can access the data, and it’s lost after 20 or so minutes. With the Application object, the data is never lost, until the server is rebooted.

Let’s put our caching system in place. Copy and paste (make sure you overwrite our previous code) the following code into our asp page;

Dim objConn, strQuery, cachedData, htmlString
'// Retrieve data from cache (if it's in there)
cachedData = Application("userlist")
'// Check if data is in cache
If IsEmpty(cachedData) = False Then
'// Data IS in cache, display the list
Response.Write cachedData
Else
'// Data is NOT in cache, get records from database
'// Get connection
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnectionString
'// Get recordset
Set objRS = Server.CreateObject("ADODB.RecordSet")
objRS.Open "SELECT userid, username FROM users", objConn
'// Loop through results
Do While Not objRS.EOF
htmlString = htmlString & objRS("userid") & " - " & objRS("username") & "
"
objRS.MoveNext
Loop
'// Close recordset
objRS.Close
'// Add records to cache
Application.Lock
Application("userlist") = htmlString
Application.UnLock
'// Display string
Response.Write htmlString
'// Clean up
Set objRS = Nothing
Set objConn = Nothing
End If

After you’ve pasted this code in the asp page, run it twice, and (hopefully) notice the slight speed increase when you ran it the second time. It might not be noticeable because the asp page doesn’t contain much code, but when your pages are bigger, and you’re doing more, you will notice!

One problem, solution?
Now that we’ve got a caching system, there’s one critical problem. What if the data gets changed? The cached data won’t be changed, and if something does get changed, incorrect data will be displayed.

Luckily, this is easily fixed. The cache just needs to be invalidated. There are several ways of doing this. Here, on AspIt, I have it set so that cached data is invalidated when a non-SELECT query (e.g UPDATE) is made to the database. For our example however, we are going to do it easier. Just invalidate the cached data within a certain time, in this example a day.

Let’s add our “invalidator”, so we will have a truly perfect caching sytem! Copy and paste the following code, or only add in the changes into our asp page;

Dim objConn, strQuery, cachedData, htmlString

'// Retrieve data from cache (if it's in there)
cachedData = Application("userlist")

'// Check if data is in cache
If IsEmpty(cachedData) = False And Application("cachedata") < Date Then
'// Data IS in cache and it's NOT invalid, display the list
Response.Write cachedData
Else
'// Data is NOT in cache or IS invalid, get records from database

'// Get connection
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnectionString

'// Get recordset
Set objRS = Server.CreateObject("ADODB.RecordSet")
objRS.Open "SELECT userid, username FROM users", objConn

'// Loop through results
Do While Not objRS.EOF
htmlString = htmlString & objRS("userid") & " - " & objRS("username") & "
"
objRS.MoveNext
Loop

'// Close recordset
objRS.Close

'// Add records to cache
Application.Lock
Application("userlist") = htmlString
'// Add cache date
Application("cachedate") = DateAdd("d", 1, Date)
Application.UnLock

'// Display string
Response.Write htmlString

'// Clean up
Set objRS = Nothing
Set objConn = Nothing
End If

You’ve finished your caching system, and (if correctly) applied should improve your database-load by high numbers (I’m guessing atleast 30%). Of course this was a very basic caching system, and I’m sure there are much better ways (Heck, AspIt uses a complete different system, but it’s the same priniciple).

Comparing OLE DB and ODBC Connections

April 18th, 2011  |  Published in technology

Comparing OLE DB and ODBC

This document compares the basic features of OLE DB to the basic features of ODBC (Open Database Connectivity). It is intended to help clarify when to use one over the other.

Introduction OLE DB vs ODBC

OLE DB and ODBC are both specifications created by Microsoft to address universal data access. Each is intended as an industry standard that will make access between one vendor’s data store and another vendor’s data consumer seamless.
Microsoft’s definition of OLE DB is a strategic system-level programming interface to data across the organization.

OLE DB is an open specification designed to build on the success of ODBC by providing an open standard for accessing all kinds of data. And the definition of ODBC is an industry standard and a component of Microsoft ® Windows ® Open Services  Architecture (WOSA). The ODBC interface makes it possible for applications to access data from a variety of database management systems (DBMSs). ODBC permits maximum interoperability—an application can access data in diverse DBMSs through a single interface. Furthermore, that application will be independent of any DBMS from which it accesses data. Users of the application can add software components called drivers, which create an interface between an application and a specific DBMS.

The two primary differences between ODBC and OLE DB are:

  • OLE DB is a component based specification and ODBC is a procedural based specification
  • SQL is the core of accessing data using ODBC but just one of the means of data access through OLE DB
  • ODBC is constrained to relational data stores; OLE DB supports all forms of data stores (relational,hierarchical, etc)

In general, OLE DB provides a richer and more flexible interface for data access because it is not tightly bound to a command syntax (like SQL in the case of ODBC).

As Microsoft points out:

Whereas ODBC was created to access relational databases, OLE DB is designed for relational and non-relational information sources, including mainframe ISAM/VSAM and hierarchical databases; e-mail and file system stores; text, graphical, and geographical data; custom business objects; and more.

ODBC on the other hand is a more established interface because it has been around longer; there are proven drivers and applications available in the market place. OLE DB is creating a better known presence, but consumer support is probably still considered limited. With the release of Windows 2000 Professional, OLE DB will be installed as part of the operating system. In Microsoft Office2000 all member applications will be OLE DB consumers. When these two major products ship, OLE DB will be much more ensconced in the marketplace. Thomas Cox does a good job of outlining ODBC’s limitations in his SUGI paper “What’s up with OLE DB?”. In recap they are:

  • tightly bound to the SQL language and relational data
  • no standard leveling of functionality (i.e. drivers do not support standard levels of functionality)
  • each flavor of SQL makes each driver unique undermining the universal intent of the API
  • difficult to deploy due since many software pieces must be synchronized (server, driver, OS, etc)

Microsoft created OLE DB to address these issues and better support Internet integration and multi-threading.

Political pros and cons

The debate over ODBC versus OLE DB boils down to two areas: political and technical. In the political arena, we have the “because Microsoft said so” argument against the “Microsoft always changes their mind” counterpoint. Over the past two to three years, Microsoft has been heavily touting OLE DB as the successor to ODBC. At PDC 98 they went as far as to state that there would no longer be continuing to develop ODBC (they would fix problems in their drivers, as needed, but not pursue future versions of the API). They plan to invest all new development into OLE DB.

So the politically correct thing to tell a user that asks which technology is to start migrating their applications to OLE DB because it is the industry direction:
  • OLE DB is Microsoft’s answer to universal data access in all forms (rectangular, relational, hierarchical, multi-dimensional, etc.)
  • With the next major release of Microsoft’s flagship products (its operating systems, and Office suite) OLE DB will be fully integrated in Microsoft’s desktop environment.
  • Microsoft’s RAD tools (VisualBasic, Visual C++, Visual Interdev) currently support OLE DB.
In following this line of reasoning, we anticipate that our own ODBC drivers will eventually be replaced by OLE DB providers. Users should consider when and how they may be able to migrate their applications from ODBC to OLE DB if this trend is realized.

Technical pros and cons of ODBC and OLE DB

Given the frequent political controversies around Microsoft’s marketing decisions, it is also important (probably more so than the political motivations!) to share the technical pros and cons between ODBC and OLE DB when talking to users:
  • If the user wants to access data independently of the SQL language, he or she should migrate to OLE DB. As we have pointed out, ODBC is bound to the SQL language. If the user’s problem can best be solved with direct table manipulation, OLE DB is a better solution.
  • If the user wants parallel interfaces for rectangular and multi-dimensional data, he or she should migrate to OLE DB. At present the only open industry standard for multi-dimensional data is based on OLE DB. If the user has a problem that involves the integration of these two forms of data, OLE DB is a better solution. It will reduce the amount of code needed.
  • If the user wants to access data in an object server, he or she must migrate to OLE DB; there is no ODBC outlet. There is no ODBC access to an IOM object server. The OLE DB provider that ships with this product is the only way a user has to get to SAS data sets in such a server.
  • If the user wants to access different data stores (local, SHARE, IOM, etc) from a single application, he or she should migrate to OLE DB. If the user plans to access data in an object server and any other data store, he should consider migrating the entire application to OLE DB. Otherwise he will be maintaining separate code paths for each access
  • method. This argument is further supported by the theoretical idea that OLE DB reduces the likelihood of differences between drivers, SQL dialects and DBMSs that has been problematic among ODBC configurations.
  • If the user wants to exploit as much of the SAS data model as possible from a thin-client application, he or she should migrate to OLE DB. While ODBC is constrained by SQL, OLE DB is not. The OLE DB specification is much richer and more extensible than ODBC. We intend to develop our providers in future releases to encapsulate as much of the SAS data model as possible. To fully exploit this data model in a thin-client environment the user should migrate to OLE DB.
  • If the user needs the ability perform concurrent updates, he or she should migrate to OLE DB. To update records using the ODBC driver the user must issue SQL UPDATE statements which are basically batch oriented updates. There is no concept of record locking in the ODBC model. OLE DB accommodates several locking models that allow multiple concurrent updates. This feature of OLE DB enables the development of much more data management applications than with ODBC.

Export Windows Scheduled Task Information to File with Command Line

March 1st, 2011  |  Published in Automation, Programming

Here is how to Export Windows Scheduled Task Information to File with Command Line:

schtasks /query /fo CSV /v >> scheduled_task_metadata.csv

This will dump a list of scheduled tasks and their advanced settings to a CSV file called “scheduled_task_metadata.cs” to whichever location you run the command prompt from.

If you don’t want the windows scheduled task’s advanced settings included, and you only want to list the name and a few high level scheduled task detail, remove the “/v” portion.

Enjoy.

MySQL Statement List and MySQL Clause List

July 25th, 2010  |  Published in Programming, technology, Web Development

MYSQL Statements and clauses

 
ALTER DATABASE
ALTER TABLE
ALTER VIEW
ANALYZE TABLE
BACKUP TABLE
CACHE INDEX
CHANGE MASTER TO
CHECK TABLE
CHECKSUM TABLE
COMMIT
CREATE DATABASE
CREATE INDEX
CREATE TABLE
CREATE VIEW
DELETE
DESCRIBE
DO
DROP DATABASE
DROP INDEX
DROP TABLE
DROP USER
DROP VIEW
EXPLAIN
FLUSH
GRANT
HANDLER
INSERT
JOIN
KILL
LOAD DATA FROM MASTER
LOAD DATA INFILE
LOAD INDEX INTO CACHE
LOAD TABLE...FROM MASTER
LOCK TABLES
OPTIMIZE TABLE
PURGE MASTER LOGS
RENAME TABLE
REPAIR TABLE
REPLACE
RESET
RESET MASTER
RESET SLAVE
RESTORE TABLE
REVOKE
ROLLBACK
ROLLBACK TO SAVEPOINT
SAVEPOINT
SELECT
SET
SET PASSWORD
SET SQL_LOG_BIN
SET TRANSACTION
SHOW BINLOG EVENTS
SHOW CHARACTER SET
SHOW COLLATION
SHOW COLUMNS
SHOW CREATE DATABASE
SHOW CREATE TABLE
SHOW CREATE VIEW
SHOW DATABASES
SHOW ENGINES
SHOW ERRORS
SHOW GRANTS
SHOW INDEX
SHOW INNODB STATUS
SHOW LOGS
SHOW MASTER LOGS
SHOW MASTER STATUS
SHOW PRIVILEGES
SHOW PROCESSLIST
SHOW SLAVE HOSTS
SHOW SLAVE STATUS
SHOW STATUS
SHOW TABLE STATUS
SHOW TABLES
SHOW VARIABLES
SHOW WARNINGS
START SLAVE
START TRANSACTION
STOP SLAVE
TRUNCATE TABLE
UNION
UNLOCK TABLES
USE

String Functions

 
AES_DECRYPT
AES_ENCRYPT
ASCII
BIN
BINARY
BIT_LENGTH
CHAR
CHAR_LENGTH
CHARACTER_LENGTH
COMPRESS
CONCAT
CONCAT_WS
CONV
DECODE
DES_DECRYPT
DES_ENCRYPT
ELT
ENCODE
ENCRYPT
EXPORT_SET
FIELD
FIND_IN_SET
HEX
INET_ATON
INET_NTOA
INSERT
INSTR
LCASE
LEFT
LENGTH
LOAD_FILE
LOCATE
LOWER
LPAD
LTRIM
MAKE_SET
MATCH    AGAINST
MD5
MID
OCT
OCTET_LENGTH
OLD_PASSWORD
ORD
PASSWORD
POSITION
QUOTE
REPEAT
REPLACE
REVERSE
RIGHT
RPAD
RTRIM
SHA
SHA1
SOUNDEX
SPACE
STRCMP
SUBSTRING
SUBSTRING_INDEX
TRIM
UCASE
UNCOMPRESS
UNCOMPRESSED_LENGTH
UNHEX
UPPER

Date and Time Functions

 
ADDDATE
ADDTIME
CONVERT_TZ
CURDATE
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURTIME
DATE
DATE_ADD
DATE_FORMAT
DATE_SUB
DATEDIFF
DAY
DAYNAME
DAYOFMONTH
DAYOFWEEK
DAYOFYEAR
EXTRACT
FROM_DAYS
FROM_UNIXTIME
GET_FORMAT
HOUR
LAST_DAY
LOCALTIME
LOCALTIMESTAMP
MAKEDATE
MAKETIME
MICROSECOND
MINUTE
MONTH
MONTHNAME
NOW
PERIOD_ADD
PERIOD_DIFF
QUARTER
SEC_TO_TIME
SECOND
STR_TO_DATE
SUBDATE
SUBTIME
SYSDATE
TIME
TIMEDIFF
TIMESTAMP
TIMESTAMPDIFF
TIMESTAMPADD
TIME_FORMAT
TIME_TO_SEC
TO_DAYS
UNIX_TIMESTAMP
UTC_DATE
UTC_TIME
UTC_TIMESTAMP
WEEK
WEEKDAY
WEEKOFYEAR
YEAR
YEARWEEK

Mathematical and Aggregate Functions

 
ABS
ACOS
ASIN
ATAN
ATAN2
AVG
BIT_AND
BIT_OR
BIT_XOR
CEIL
CEILING
COS
COT
COUNT
CRC32
DEGREES
EXP
FLOOR
FORMAT
GREATEST
GROUP_CONCAT
LEAST
LN
LOG
LOG2
LOG10
MAX
MIN
MOD
PI
POW
POWER
RADIANS
RAND
ROUND
SIGN
SIN
SQRT
STD
STDDEV
SUM
TAN
TRUNCATE
VARIANCE

Flow Control Functions

 
CASE
IF
IFNULL
NULLIF

Command-Line Utilities

 
comp_err
isamchk
make_binary_distribution
msql2mysql
my_print_defaults
myisamchk
myisamlog
myisampack
mysqlaccess
mysqladmin
mysqlbinlog
mysqlbug
mysqlcheck
mysqldump
mysqldumpslow
mysqlhotcopy
mysqlimport
mysqlshow
perror

PHP API functions with MySQL

 
mysql_affected_rows
mysql_change_user
mysql_client_encoding
mysql_close
mysql_connect
mysql_create_db
mysql_data_seek
mysql_db_name
mysql_db_query
mysql_drop_db
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_array
mysql_fetch_assoc
mysql_fetch_field
mysql_fetch_lengths
mysql_fetch_object
mysql_fetch_row
mysql_field_flags
mysql_field_len
mysql_field_name
mysql_field_seek
mysql_field_table
mysql_field_type
mysql_free_result
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_info
mysql_insert_id
mysql_list_dbs
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_num_fields
mysql_num_rows
mysql_pconnect
mysql_ping
mysql_query
mysql_real_escape_string
mysql_result
mysql_select_db
mysql_stat
mysql_tablename
mysql_thread_id
mysql_unbuffered_query

MySql Command Line Syntax

July 25th, 2010  |  Published in Programming, technology, Web Development

These are some MySql commands (most run at the command line in linux) that I’ve been collecting since getting a few sites set up on linode. The “#” indicates that it is to be run from the unix shell. When you see “mysql>” the command is to be run from the MySQL command prompt after logging into MySQL.

MySQL Command to login (from unix shell) use -h only if needed.

# [mysql dir]/bin/mysql -h hostname -u root -p

# [mysql dir]/bin/mysql -h hostname -u root -p

MySQL Command to Create a database on the sql server.

mysql> create database [databasename];

mysql> create database [databasename];

MySQL Command to List all databases on the sql server.

mysql> show databases;

mysql> show databases;

MySQL Command to Switch to a database.

mysql> use [db name];

mysql> use [db name];

MySQL Command to see all the tables in the db.

mysql> show tables;

mysql> show tables;

MySQL Command to see database’s field formats.

mysql> describe [table name];

mysql> describe [table name];

MySQL Command to delete a db.

mysql> drop database [database name];

mysql> drop database [database name];

MySQL Command to delete a table.

mysql> drop table [table name];

mysql> drop table [table name];

MySQL Command to Join tables on common columns.

mysql> select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on lookup.personid=person.personid=statement to join birthday in person table with primary illustration id;

mysql> select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on lookup.personid=person.personid=statement to join birthday in person table with primary illustration id;

MySQL Command to Create a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password')); 
mysql> flush privileges;

# mysql -u root -p mysql> use mysql; mysql> INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password')); mysql> flush privileges;

MySQL Command Change a users password from unix shell.

# [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password 'new-password'

# [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password 'new-password'

MySQL Command to Change a users password from MySQL prompt. Login as root. Set the password. Update privs.

# mysql -u root -p
mysql> SET PASSWORD FOR 'user'@'hostname' = PASSWORD('passwordhere');
mysql> flush privileges;

# mysql -u root -p mysql> SET PASSWORD FOR 'user'@'hostname' = PASSWORD('passwordhere'); mysql> flush privileges;

MySQL Command to Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.

# /etc/init.d/mysql stop
# mysqld_safe --skip-grant-tables &
# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;
mysql> quit<br /> 
# /etc/init.d/mysql stop
# /etc/init.d/mysql start

# /etc/init.d/mysql stop # mysqld_safe --skip-grant-tables & # mysql -u root mysql> use mysql; mysql> update user set password=PASSWORD("newrootpassword") where User='root'; mysql> flush privileges; mysql> quit<br /> # /etc/init.d/mysql stop # /etc/init.d/mysql start

MySQL Command to Set a root password if there is on root password.

# mysqladmin -u root password newpassword

# mysqladmin -u root password newpassword

MySQL Command to Update a root password.

# mysqladmin -u root -p oldpassword newpassword

# mysqladmin -u root -p oldpassword newpassword

MySQL Command to Allow the user “bob” to connect to the server from localhost using the password “passwd”.
Login as root. Switch to the MySQL db. Give privs. Update privs.

# mysql -u root -p 
mysql> use mysql; 
mysql> grant usage on *.* to bob@localhost identified by 'passwd';
mysql> flush privileges;

# mysql -u root -p mysql> use mysql; mysql> grant usage on *.* to bob@localhost identified by 'passwd'; mysql> flush privileges;

MySQL Command Give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs.

# mysql -u root -p 
mysql> use mysql; 
mysql> INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES 
('%','databasename','username','Y','Y','Y','Y','Y','N'); 
mysql> flush privileges;
# or 
mysql> grant all privileges on databasename.* to username@localhost;
mysql> flush privileges;

# mysql -u root -p mysql> use mysql; mysql> INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES ('%','databasename','username','Y','Y','Y','Y','Y','N'); mysql> flush privileges; # or mysql> grant all privileges on databasename.* to username@localhost; mysql> flush privileges;

MySQL Command to update info already in a table.

mysql> UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';

mysql> UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';

MySQL Command to Delete a row(s) from a table.

mysql> DELETE from [table name] where [field name] = 'whatever';

mysql> DELETE from [table name] where [field name] = 'whatever';

MySQL Command to Update database permissions/privilages.

mysql> flush privileges;

mysql> flush privileges;

MySQL Command to Delete a column.

mysql> alter table [table name] drop column [column name];

mysql> alter table [table name] drop column [column name];

MySQL Command to Add a new column to db.

mysql> alter table [table name] add column [new column name] varchar (20);

mysql> alter table [table name] add column [new column name] varchar (20);

MySQL Command to Change column name.

mysql> alter table [table name] change [old column name] [new column name] varchar (50);

mysql> alter table [table name] change [old column name] [new column name] varchar (50);

MySQL Command to Make a unique column so you get no dupes.

mysql> alter table [table name] add unique ([column name]);

mysql> alter table [table name] add unique ([column name]);

MySQL Command to Make a column bigger.

mysql> alter table [table name] modify [column name] VARCHAR(3);

mysql> alter table [table name] modify [column name] VARCHAR(3);

MySQL Command to Delete unique from table.

mysql> alter table [table name] drop index [colmn name];

mysql> alter table [table name] drop index [colmn name];

MySQL Command to Load a CSV file into a table.

mysql> LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3);

mysql> LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3);

MySQL Command to Dump all databases for backup. Backup file is sql commands to recreate all db’s.

# [mysql dir]/bin/mysqldump -u root -ppassword --opt > /tmp/alldatabases.sql

# [mysql dir]/bin/mysqldump -u root -ppassword --opt > /tmp/alldatabases.sql

MySQL Command to Dump one database for backup.

# [mysql dir]/bin/mysqldump -u username -ppassword --databases databasename > /tmp/databasename.sql

# [mysql dir]/bin/mysqldump -u username -ppassword --databases databasename > /tmp/databasename.sql

MySQL Command to Dump a table from a database.

# [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql

# [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql

MySQL Command to Restore database (or database table) from backup.

# [mysql dir]/bin/mysql -u username -ppassword databasename < /tmp/databasename.sql

# [mysql dir]/bin/mysql -u username -ppassword databasename < /tmp/databasename.sql

MySQL Command to Create Table Example 1.

mysql> CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid 
VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));

mysql> CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));

MySQL Command to Create Table Example 2.

mysql> create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default 
'bato');

mysql> create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default 'bato');

MySQL Command to Show all data in a table.

mysql> SELECT * FROM [table name];

mysql> SELECT * FROM [table name];

MySQL Command to Returns the columns and column information pertaining to the designated table.

mysql> show columns from [table name];

mysql> show columns from [table name];

MySQL Command to Show certain selected rows with the value “whatever”.

mysql> SELECT * FROM [table name] WHERE [field name] = "whatever";

mysql> SELECT * FROM [table name] WHERE [field name] = "whatever";

MySQL Command to Show all records containing the name “Bob” AND the phone number ‘3444444’.

mysql> SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';

mysql> SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';

MySQL Command to Show all records not containing the name “Bob” AND the phone number ‘3444444’ order by the phone_number field.

mysql> SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;

mysql> SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;

MySQL Command to Show all records starting with the letters ‘bob’ AND the phone number ‘3444444’.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';

MySQL Command to Show all records starting with the letters ‘bob’ AND the phone number ‘3444444’ limit to records 1 through 5.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444' limit 1,5;

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444' limit 1,5;

MySQL Command to Use a regular expression to find records. Use “REGEXP BINARY” to force case-sensitivity. This finds any record beginning with a.

mysql> SELECT * FROM [table name] WHERE rec RLIKE "^a";

mysql> SELECT * FROM [table name] WHERE rec RLIKE "^a";

MySQL Command to Show unique records.

mysql> SELECT DISTINCT [column name] FROM [table name];

mysql> SELECT DISTINCT [column name] FROM [table name];

MySQL Command to Show selected records sorted in an ascending (asc) or descending (desc).

mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;

mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;

MySQL Command to Return number of rows.

mysql> SELECT COUNT(*) FROM [table name];

mysql> SELECT COUNT(*) FROM [table name];

MySQL Command to Sum a column.

mysql> SELECT SUM(*) FROM [table name];

mysql> SELECT SUM(*) FROM [table name];

Ripoff Alert – Domain Registry of Canada Scam

July 21st, 2010  |  Published in Internet, Web Hosting, Website Management

I received a snail mail letter today from the Canadian Domain Authority. Is it a scam? Well, the Canadian Domain Authority sent the unsolicited letter to me because I am the registrant of domain name (.com) that contains the name of one of the provinces of Canada in it.

The envelope and presentation of the scam letter was very much like those of government communications. They make unsuspecting domain owners fear that the Canadian Government is forcing them to register with them if they want to keep their domain name.

This is all a phishing scam by the Canadian Domain Authority to lure unsuspecting domain owners to pay exorbitant fees to renew their domains.

Whats with the “…of Canada”? It’s like they think it makes it sound more official. Morons.

This seriously roasts me because they will probably get away with what I call deliberate and obvious intent to mislead the consumer into paying extortionist prices to renew their domains. Actually, its more like fraud, because there is deliberate mis-leading wording.

This is such a scam letter from the Domain Registry of Canada. Don’t fall for the droc.com scam.

In 2004 the FTC forced the Domain Registry of America to refund it’s 50,000 customers. I hope the same will happen to the Ripoff scam of the Canadian Domain Authority.

1&1 Scam Ripoff – Unlimited Traffic Promotion from 1 and 1

February 20th, 2010  |  Published in Web Hosting  |  3 Comments

Previously, I posted about the horrible customer experience I had with 1&1 corporation when they basically fired me as a customer when my sites became too popular for their shared hosting plan. All they had to do was inform me of the issue (before shutting my sites down with no notice or warning) and I’d have gladly shelled out for a dedicated server.  Instead, and without any warning, I get a service unavailable message from 1&1. Beyond that, as I’m rushing to transfer all of my holdings out of that registrar, I encounter many error messages saying that there is a domain registration error from 1&1.

I’ve long since switched to godaddy, who has english speaking, United States based customer service, and they have blown my expectations out of the water.

Anyway, over a year after I switch, i get a promotional email from 1and1 marketing, showboating an offer of unlimited traffic. As vague as that is, i know it will mislead many customers into thinking that it means unlimited everything, when it does not!

When you talk about shared hosting, there are several factors:

  • number of domains you can host (unlimited according to 1and1)
  • number of GB of transfer per month This is what they are really saying is unlimited
  • RAM/memory available – they don’t specify this for shared hosting, nor do they give a method for customer to monitor it. This is what will limit you before GBs of transfer does.
  • CPU Time allowed – they don’t specify this for shared hosting, nor do they give a method for customer to monitor it. This is what will limit you before GBs of transfer does.

The last two, factors that you can not monitor yourself, and factors that are not called out in your “plan” are what will get you kicked off faster than any other factor (including non-payment). The idea is that you are on shared hosting, and you should use a proportionate amount of the two items – CPU Time and RAM/Memory.

My point is, the recent 1&1 ad is a deceptive marketing piece, and I call it nothing more than another scam by 1&1 ripoff web hosting.

Again, if anyone knows the direct phone numbers to any of the 1&1 corporate folks in the US, please post them below.

View older articles:


Dec 30, 2011
eZooms Bot User Agent

by admin | Read | No Comments

I am trying to find the group/entity/company behind the ezooms.bot (ezooms.bot@gmail.com) User agents: Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com) Some IP: 220.181.108.79 If you know any more info on this spider/bot/crawler/probe, please post below.


Dec 6, 2011
SQL Full Outer Join Three Tables

by admin | Read | No Comments

Here is some code to do a full outer join on three tables. In the example, the three full outer joins are done on two columns , but it works just the same if you only have a single join column. CREATE TABLE ZA (T CHAR(1), O CHAR(1)) CREATE TABLE ZB (T CHAR(1), O CHAR(1)) […]


Dec 2, 2011
Classic ASP Data Caching for Performance

by admin | Read | No Comments

Here is an OLD article I had about data caching in classic asp using the application object. When it comes to application performance on your web servers, ever little bit counts. Howto build a database caching system Introduction In this tutorial I will teach you how to build a simple database caching system to improve […]


Apr 18, 2011
Comparing OLE DB and ODBC Connections

by admin | Read | No Comments

Comparing OLE DB and ODBC This document compares the basic features of OLE DB to the basic features of ODBC (Open Database Connectivity). It is intended to help clarify when to use one over the other. Introduction OLE DB vs ODBC OLE DB and ODBC are both specifications created by Microsoft to address universal data access. […]


Mar 1, 2011
Export Windows Scheduled Task Information to File with Command Line

by admin | Read | No Comments

Here is how to Export Windows Scheduled Task Information to File with Command Line: schtasks /query /fo CSV /v >> scheduled_task_metadata.csv This will dump a list of scheduled tasks and their advanced settings to a CSV file called “scheduled_task_metadata.cs” to whichever location you run the command prompt from. If you don’t want the windows scheduled […]


Jul 25, 2010
MySQL Statement List and MySQL Clause List

by admin | Read | No Comments

MYSQL Statements and clauses ALTER DATABASE ALTER TABLE ALTER VIEW ANALYZE TABLE BACKUP TABLE CACHE INDEX CHANGE MASTER TO CHECK TABLE CHECKSUM TABLE COMMIT CREATE DATABASE CREATE INDEX CREATE TABLE CREATE VIEW DELETE DESCRIBE DO DROP DATABASE DROP INDEX DROP TABLE DROP USER DROP VIEW EXPLAIN FLUSH GRANT HANDLER INSERT JOIN KILL LOAD DATA FROM […]

About Robar's Pages

A technology blog about classic ASP and vbScript from the east coast

Tags

1and1 adsense asp caribbean classic asp crowdsourcing CTR cuba Cueva de Pirata customer service database dominican republic forum management godaddy google Halifax hosting hotel ideagora Internet Linux MySQL objWmiService outsourcing php Pirates Cave plugin scripting scripts SEO Skateboarding sql travel Varadero vbs vbscript web browser web development wedding What is Crowdsourcing? wikipedia windows windows scripting winmgmts xp

Pages

  • About Robar’s Pages
    • Privacy Policy for robarspages.ca
  • Classic ASP Programming and Development
  • Gran Bahia Principe Wedding
  • YouTube Extension Plugins for WordPress

Categories

  • Automation
  • Halifax
  • Internet
  • Internet Marketing
  • Programming
  • SEO
  • sitemap
  • Skateboarding
  • technology
  • travel
  • Web Development
  • Web Hosting
  • Website Management
  • wedding

Contributors

  • admin

Popular

  • 1and1 Corporate Headquarters Phone Number
  • Our Online Wedding Guestbook
  • Caribbean Travel Tips
  • Grand Palladium Bavaro Photos Pictures Videos Reviews
  • vbscript Select Case for Range of Values
  • Gran Bahia Principe Wedding
  • 1and1 Service Unavailable Message
  • 1and1 "There is a domain registration error"
  • Snitz Forum SEO
  • 1&1 Scam Ripoff - Unlimited Traffic Promotion from 1 and 1
  • Blogroll

    • Billiard Video Television Niche video site for the cue sport enthusiast. (Last updated: December 31, 1969 9:00 pm)
      Niche video site for the cue sport enthusiast.

  • Recent Posts

    • HTTP_X_EAC_REQUEST
    • eZooms Bot User Agent
    • SQL Full Outer Join Three Tables
    • Classic ASP Data Caching for Performance
    • Comparing OLE DB and ODBC Connections

    Recent Comments

    • AP on 1and1 Corporate Headquarters Phone Number
    • AJ on 1and1 Corporate Headquarters Phone Number
    • cordova on 1and1 Corporate Headquarters Phone Number
    • mike on 1and1 Corporate Headquarters Phone Number
    • David on Regex MM/YYYY Regular Expression for Credit Card Expiration Date
    ©2025 Robar's Pages
    Sitemap and Table Of Contents