Categories
Linux

Useful Linux Commands

Yes, I know.  This is pretty thin.  But as I stumble through my infrequent tasks in Linux, I need to write down the little bits that I need to remember.  Feel free to chip in!

To Delete a Folder With Contents

[sourcecode language="bash"]
rm -rf {folder}
[/sourcecode]

Show full path of current dir in linux command prompt

[sourcecode language="shell"]
PS1="[\u@\h \w]\\$ "
[/sourcecode]

Categories
MySQL

MySQL Error Number 1045

Connection attempts to a MySQL database can return "MySQL Error Number 1045".  This is a frustrating error, but has a reasonably simple solution.

While this solution is presented in the context of databases hosted on dreamhost.com accessed by the MySQL Administrator tool, most of the discussion is likely to apply to anyone encountering the 1045 error.

At the root of the error is the fact that the database server validates not only the user account making the request but also the machine the request is being made from.  To resolve the error it is necessary to tell the server that the machine is authorized.

The first step is determine the fully qualified host name of the machine you are accessing from.  The easiest way to do that is to google "display my host name".  This will locate sites like www.displaymyhostname.com, which will show you the fully qalified host name for your machine.  Copy this, you'll need it in a moment.

In the case of Dreamhost.com databases, log into your dreamhost.com control panel, then select MySQL databases from the menu.

Scroll down to the database you were trying to access, then to the right of the database name click the username being used.

The next page lists the databases that user has access to and the rights held on those databases.

In the "Allowable Hosts" section, add, on a separate line, the fully qualified host name you identified above.

Save the changes, and you're done.  You'll now be able to access your database.

Categories
Web Development

Internal Server area accessing WAMP Server Alias

Problem:

When WAMP Server is installed and a directory alias is configured, the following error is encountered when trying to access the site;

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Solution:

Start WAMP Server from the Start menu.

Click the WAMP icon in the notification area.

Select Apache, then Apache Modules.

Scroll the list to rewrite_module and select it.

Click the WAMP icon again, then click "Restart All Services".

Categories
Joomla!

Display an alternate Joomla Template

Sometimes you just want to see what your site would look like in another template.

Simply add the parameter ?template=template_name to your URL and you’ll see it.

Technorati Tags: ,
Categories
Database MySQL

MySQL GUI Tools – Still ready for Prime Time

MySQL ceased development of their GUI Tools, MySQL Administrator and MySQL Query Browser, with the release of their MySQL Workbench product.

Workbench is supposed to incorporate the functions of Administrator and Query Browser, but does a poor job of it.  While it has many new features which are no doubt very useful, it does a very poor job on some of the basic functions.  Inexplicably, it does not allow you to edit the results of a query without using a non-standard SQL syntax and won't let you edit the results at all unless all the fields have been returned in the query.  The only way you can limit the query is with WHERE clauses if you want to edit the results.

The MySQL representative on the support forum doesn't see that as a problem, but this sort of ad hoc editing is what made query editor so useful.  Fully 90% of my work in Query Editor is to edit small data subsets.  For instance, in a membership table you might wish to return a query like SELECT fname,lname,city FROM members WHERE lname = ‘Smith’; to isolate a record   As it stands, workbench won’t let you limit the query by restricting the fields.  You can use the WHERE clause, but you can’t limit the fields.  Not much help if you have dozens of fields in the table.

Until this is rectified, assuming it ever is, I recommend installing the Administrator and Query Browser from the old GUI tools package which is still available at the link below.  The best bet for the foreseeable future is to install the old tools with the most recent version of MySQL Workbench.  Get used to the new tool, and use the old tools for what they do best until Workbench catches up.

As much as I love MySQL and Open Source in general, I find the blasé attitude of the MySQL support staff inexplicable.  Why they would cripple their new tool by removing a useful function available in the previous tool is beyond me.

imageDownload and install the old MySQL GUI tools

Download and run the old GUI Tools here.  If you’re not familiar with .msi files, they are the Microsoft Installer format, just double-click them and they’ll start the install.

http://downloads.mysql.com/archives/MySQLGUITools/ mysql-gui-tools-5.0-r12-win32.msi

When installing, select Custom on the Setup Type dialog.  Don't install MySQL Migration Toolkit or Language Support unless you really need them.