Reset TYPO3 password

If you forget your typo3 password, you can reset it using the mysql command line tool as follows:


mysql> use typo3;
mysql> update be_users set password='bacb98acf97e0b6112b1d1b650b84971' where username = 'admin';

This resets the admin user password to “joh316″.

Tagged with:
 

Install phpMyAdmin

phpMyAdmin is web-based PHP application for managing MySQL databases. It is fairly easy to install and configure.

Download the latest stable version from the phpMyAdmin web site, and extract it to a location of your choice. I prefer to keep the installation outside of the web root and use an apache alias to reference it.
(more…)

Tagged with:
 

Backup and Restore Databases

The following steps can be executed as a non privileged user on the server, however, the username and password you use with the commands needs to be a database user that has r/w privileges within MySQL (think “sa” account for Microsoft SQL Server).

1. Export the database to a SQL file.

[user@host]$ mysqldump --opt --user=dbuser \
--password database > dumpfile.sql

2. Edit the dump file and put these lines at the beginning:

SET AUTOCOMMIT = 0;
SET FOREIGN_KEY_CHECKS=0;

3. Put these lines at the end:

SET FOREIGN_KEY_CHECKS = 1;
COMMIT;
SET AUTOCOMMIT = 1;

4. Import the database SQL file into MySQL. This will overwrite the contents of the current database.

[user@host]$ mysql --user=dbuser \
--password database < dumpfile.sql

Click here for a good shell script that automates the backup of MySQL databases. Version 2.5 is available here for download.

 

Set the Root Password

After installing MySQL, the first thing you’ll want to do is reset the root password for MySQL. You can achieve this using the following command:

[root@myhost]# mysqladmin -u root password new-password

Set MySQL to start automatically with the following command

[root@myhost]# /sbin/chkconfig mysqld on

Update:
A much better way to secure your installation of MySQL is to run the mysql_secure_installation command. This prompts you to set or change the root password, remove guest access and test databases, etc.