In this tutorial we are now going to see how to open the phpMyAdmin from the WampServer icon from the system tray and changing the root password.
Steps to change root password:
- Open the MySQL console by selecting the menu shown above.
- After clicking on the “MySQL console” following console window will be opened where default password is empty so we hit one enter key to continue without typing –
- Now in order to change the default password we need to type following query in the MySQL console (we are setting password as – “
SET PASSWORD FOR root@localhost=PASSWORD('jordan');
- In the older versions of the phpmyadmin we need to manually change the password in the phpmyadmin config file but in the current version we can skip this step.
Updating the password of root or any user :
We can use following query in the mysql console for updating the query –
mysql> UPDATE mysql.user
SET Password = PASSWORD("AMMAN")
WHERE User = "root";
In the above example we are setting password “AMMAN” to the user “root”.
In order to back up your database via SSH or Telnet you will require 2 things:
- SSH or Telnet access to your site. You will need to check with your hosting company to see if this is available.
- An SSH/Telnet Client, such as PuTTy.
Open your SSH/Telnet client and log into your website. The command line prompt you will see will vary by OS.
For most hosting companies, this will bring you into the FTP root folder.
Type in the following to create a backup in the current directory:
mysqldump --opt -Q -u dbusername -p databasename > backupname.sql
Or to create a backup in a separate directory (signified by /path/to/) type:
mysqldump --opt -Q -u dbusername -p databasename > /path/to/backupname.sql
You will be prompted for the database password. Enter it and the database will backup.
If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The servername will be the same as in your config.php. The command line will be:
mysqldump --opt -Q -h servername -u dbusername -p databasename > backupname.sql
mysqldump --opt -Q -h servername -u dbusername -p databasename > /path/to/backupname.sql
You can then, if you wish, download the backup to your home computer.