MySQL – How to Create an Admin User Account

If you want to create an additional admin account for MySQL server, connect to the MySQL server with a MySQL client program and execute the following command:

GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Change the word “admin” to whatever username you want to use for the admin account and change “password” to whatever password you want to use for that account.

The above SQL command creates an admin account that can only connect from the server which is running the MySQL database service. If you want to allow the admin account to log in from any IP address then replace “localhost” with “%”. The “%” acts as a wild card character.

GRANT ALL ON *.* TO 'admin'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

If you want to only allow the admin account to log in from a specific IP or range of IPs then use the wildcard character:

GRANT ALL ON *.* TO 'admin'@'192.168.1.%' IDENTIFIED BY 'password' WITH GRANT OPTION;

The above example allows the admin account to log in from any IP address that starts with 192.168.1.

MySQL logo

PERL – How to Get the File Path For The Running PERL Script

Here is some sample code for determining what the file path is to the PERL script containing the code:

use Cwd qw(realpath);
my $fullpath = realpath($0);

If you just do $0 alone in the second line, that only gives you the filename that was executed. For example, if you include the first line of code above in a PERL script file named “perl foo.pl” $0 will return “foo.pl”. But if you ran the PERL script using an absolute path like this “perl /user/local/foo.pl”, $0 would return “/user/local/foo.pl”. So the example above uses the realpath() function to guarantee the full absolute path is always returned.

Code

OS X – How to Search For a Substring Inside of GZIP and BZ2 Files

This tip is really a generic *Nix command so it should not only work in OS X but also in other flavors of UNIX such as Linux.

In OS X a lot of the log files are auto-archived into compressed GZIP files in Tiger (Mac OS X 10.4) and BZ2 files in Leopard (Mac OS X 10.5). If you need to search for an occurrence of a word or other string of text in a compressed GZIP file, you can use the following terminal command:

zgrep someString theLogFileName.log.gz

As an example, say you want to search for the word “error” in a compressed system log in Tiger. To do this you would launch the Terminal application and run the command:

zgrep error /var/log/system.log.0.gz

Alternatively you can search all compressed system log files in a single command by using an asterisk (*) as a “wild card” character:

zgrep error /var/log/system.log*

Leopard uses the BZ2 compression scheme for most of its log files and you can similarly search those files by using the bzgrep command. For example, say you wanted to search all the application firewall logs for instances of the word “connection”. To do this you would run the following command in the Terminal application:

bzgrep connection /var/log/appfirewall.log*

If you need to search for a string that consists of more than one word separated by spaces, you would need to surround the search string in quotation marks:

bzgrep "connection attempt" /var/log/appfirewall.log*

Sherlock

Access Windows Live Hotmail in Outlook

Microsoft Office Outlook Connector is a free program released by Microsoft which will allow you to access your Hotmail and Microsoft Office Live email accounts from within Outlook. Here is Microsoft’s official description of the application:

With Outlook Connector, you can use Outlook 2003 or Outlook 2007 to access and manage your Windows Live Hotmail or Office Live Mail accounts, including e-mail messages and contacts for free! Calendar, tasks and notes synchronization are not available on all services. If your service offers calendar synchronization, tasks and notes will synchronize as well. See the feature list for your service for details.

Outlook Connector enables you to use your Live Hotmail accounts within Outlook:

  • Read and send your Office Live Mail/Windows Live Hotmail e-mail messages.
  • Manage your Live Mail Contacts.
  • Use advanced options for blocking junk e-mail messages.
  • Manage multiple e-mail accounts in one place.

With a paid subscription, Outlook Connector enables these additional features:

  • Manage, share, and synchronize your Windows Live Calendar in Outlook.
  • Access your Tasks and Notes.

You can download the application from Microsoft from this web page: Link

Microsoft Office Connector