Changing MySQL Password for Alfresco EC2

Well, all kinds of walls are breaking down this week.  I’m using MySQL for the first time.  Most of my DB experience is in Oracle, I’ve used Sybase, but for open source databases, I’m a fan of Postgresql, and Derby is great for Java on the client. I’ve avoided MySQL since I can’t respect a database that didn’t have transactions until version 5 and uses a “root” user.

The official Alfresco EC2 AMI uses MySQL.  There are two users – the root (the MySQL root) and the alfresco user, both are in the mysql database (as opposed to the alfresco database).  To change the default passwords do this:

ubuntu@domU-12-31-39-09-E1-A1:~$ mysqladmin -u root -p'alfresco' password 'newpass'

ubuntu@domU-12-31-39-09-E1-A1:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 5.1.37-1ubuntu5 (Ubuntu)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> update user set password=PASSWORD(“new password”) where User=’alfresco’;

mysql> show databases;
+——————–+
| Database           |
+——————–+
| information_schema |
| alfresco           |
| mysql              |
+——————–+
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> update user set password=PASSWORD(“new password”) where User=’alfresco’;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0

I’m surprised there were two rows updated, but we’ll close our eyes and cross our fingers.

Lastly, change it in the alfresco config file:

sudo vi  /usr/share/tomcat6/shared/classes/alfresco-global.properties

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: