http://trixbox.org/forums/trixbox-forums/open-discussion/change-default-sql-password-freepbx-version-2-6
Step 1) mysql -u root –p [ENTER]
Step 2) Enter password: passw0rd [ENTER]
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3743 to server version: 5.0.22
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
Step 3) mysql> use mysql; [ENTER]
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
Step 4) mysql> update user set password = PASSWORD(‘NEW_PASSWORD’) where User = ‘asteriskuser’; [ENTER]`
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
Step 5) mysql> grant all privileges on *.* to root@localhost identified by ”NEW_PASSWORD ‘ with grant option; [ENTER]
Query OK, 0 rows affected (0.00 sec)
Step 6) mysql> show databases; [ENTER]
+————————+
| Database |
+————————+
| information_schema |
| asterisk |
| asteriskcdrdb |
| asteriskrealtime |
| endpoints |
| meetme |
| mysql |
| sugarcrm |
| test |
+————————+
9 rows in set (0.00 sec)
Step 7) mysql> grant all privileges on meetme.* to asteriskuser@localhost; [ENTER]
Query OK, 0 rows affected (0.00 sec)
Step 7) mysql> grant all privileges on endpoints.* to asteriskuser@localhost; [ENTER]
Query OK, 0 rows affected (0.00 sec)
Step 8) mysql> grant all privileges on asteriskrealtime.* to asteriskuser@localhost; [ENTER]
Query OK, 0 rows affected (0.00 sec)
Step 9) mysql> grant all privileges on asteriskcdrdb.* to asteriskuser@localhost; [ENTER]
Query OK, 0 rows affected (0.00 sec)
Step 10) mysql> grant all privileges on asterisk.* to asteriskuser@localhost; [ENTER]
Query OK, 0 rows affected (0.00 sec)
Step 11) mysql> flush privileges; [ENTER]
Query OK, 0 rows affected (0.00 sec)
mysql> exit [ENTER]
Bye
OK THIS PART IS FINISHED!
Next…..
Change default passwords:
To change the FreePBX manager pass, you need to edit two separate files and put in the new password.
Step 12) nano /etc/asterisk/manager.conf [ENTER]
Find ‘secret = amp111’ under the [admin] section. Change ‘amp11’ to your new desired password. CTRL+X followed by ‘Y’ to save and exit.
Now, we need to edit the /etc/amportal.conf to use our new password.
Step 13) nano /etc/amportal.conf [ENTER]
Find the line that says ‘AMPMGRPASS=amp111’ and change the ‘amp11’ to the new password you just set. CTRL+X followed by ‘Y’ to save and exit.
Now we need to edit the /etc/cbmysql.conf
Step 14) nano /etc/asterisk/cbmysql.conf [ENTER]
Find the line that says password=passw0rd’ and change the ‘ passw0rd’ to the new password you just set. CTRL+X followed by ‘Y’ to save and exit.
Now we need to edit the /var/www/html/web-meetme/lib/database.php
Step 15) nano /var/www/html/web-meetme/lib/database.php [ENTER]
Find the line that says $password = ‘passw0rd’;’ and change the ‘passw0rd’ to the new password you just set. CTRL+X followed by ‘Y’ to save and exit.
You will also need to update the password in the /etc/asterisk/cdr_mysql.conf file for call detail records (cdr) and in /etc/asterisk/res_mysql
Step 16) nano /etc/asterisk/cdr_mysql.conf [ENTER]
Find the line that says ‘password=amp109’ and change the ‘amp109’ to the new password you just set. CTRL+X followed by ‘Y’ to save and exit.
Step 17) nano /etc/asterisk/res_mysql.conf [ENTER]
Find the line that says ‘dbpass=amp109’ and change the ‘amp109’ to the new password you just set. CTRL+X followed by ‘Y’ to save and exit.
Step 18) service mysqld restart [ENTER]
Step 19) amportal restart [ENTER]
Ready to Rock ‘n’ Roll!
*** NOTE: FreePBX/MySQL does not like having an exclamation point (!) in the password. There may be other special characters that it doesn’t like also.
Document prepared by: Scott J. Arnold 09/11/2008 Contact: Scott@TheVOIPWiz.com
IAX2 Hardware at http://www.thevoipwiz.com