Archive for January, 2007

Monica has a webpage that uses php to draw an image. After the hep upgrade, it stopped working. Turns out I needed to install the php-gd package which adds support for the gd graphics library to PHP.

Be sure to restart httpd after adding the package.

Start with:

 mysql -u username -p 

Then enter password.

Shows all databases allowed to see.

mysql> show databases;

Pick database to work on

mysql> use database_name;

See tables in database

mysql> show tables;

Get description of table

mysql> describe table_name;

Simple query to see all data in table_name

mysql> select * from table_name;

To prepare for websites using php and databasese, mysql-server was installed. Upon starting with /etc/rc.d/init.d/mysqld start, got an error message about group mysql being invalid. Turns out that we didn’t have a mysql group. Normally, the group mysql would get GID 27. However, that GID was already in use for us. So, mysql was given GID 241 because that was the GID of a directory created from the installation.

/etc/rc.d/init.d/mysqld start

mysqladmin -u root password 'new_password'

mysql -u root -p
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select Host,User,Password from user where user='';
+-----------+------+----------+
| Host      | User | Password |
+-----------+------+----------+
| comp      |      |          |
| localhost |      |          |
+-----------+------+----------+
2 rows in set (0.00 sec)

mysql> select Host,User,Password from user where Password='';
+-----------+------+----------+
| Host      | User | Password |
+-----------+------+----------+
| comp      | root |          |
| comp      |      |          |
| localhost |      |          |
+-----------+------+----------+
3 rows in set (0.00 sec)

Now need to delete those empty users.

mysql> delete from user where User='';
Query OK, 2 rows affected (0.00 sec)

mysql> select Host,User,Password from user where Password='';
+------+------+----------+
| Host | User | Password |
+------+------+----------+
| comp | root |          |
+------+------+----------+
1 row in set (0.00 sec)

mysql> delete from user where Password='';
Query OK, 1 row affected (0.00 sec)

mysql> select Host,User,Password from user;
+-----------+------+------------------+
| Host      | User | Password         |
+-----------+------+------------------+
| localhost | root | 1e3392c069a69a58 |
+-----------+------+------------------+
1 row in set (0.00 sec)

So we are now left with one user (root) on the localhost with a password. New users can be created to take care of different databases.

pbsnodes -a -lists all nodes and their status
qstat -a -lists all jobs currently in queue and their status

checknode nodename – gives details about a particular node
checkjob job_number – gives details about a particular job
showstart job_number – gives a rough approximation as to when a job may start
showq – will give info about all the jobs, the important stuff is at the end where it will show blocked jobs. These can be unblocked with:

releasehold job_number – unblock or release a hold

Add the line:

ADMIN3: ALL

to maui.cfg to let everyone run commands that get info about currently running jobs and compute nodes. These users are not allowed to make changes to jobs or priorities. Note that the ALL must be in all caps, or it doesn’t work properly.

Unless specifically allowed, when users run the qstat command, they only see their own jobs. In order to see all the jobs in the queue, no matter who owns them, add the following line in qmgr:

set server query_other_jobs=true

The new version of apache had the default character set as UTF-8. This apparently overrides whatever is in the webpages because Mel had a page that kept coming up with a bunch of odd characters. They would go away when the user changed the text encoding to Western iso-8859-1. So, I just changed the default text encoding in the httpd.conf file.

# Changed the default character encoding as somme pages were looking strange --MH 3 Jan 2007
AddDefaultCharset iso-8859-1
#AddDefaultCharset UTF-8