Monday, August 17, 2015

How to reset your first installed mysql database password?

  • For newly installed mysql database, the default database password is empty
  • In order to reset the password, type in the "mysql" command at terminal window. 
  • Type in the command below to reset the password
mysql > UPDATE mysql.user SET password=password('password') WHERE user='root' AND host='localhost';
  • If the error message as shown below is displayed
ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
  • Add the 2 parameter to my.cnf file
[mysqld]
skip-grant-tables
skip-networking
  • Restart mysql services
  • Type in command "mysql" to login into mysql, rerun the command below, you should be able to reset your root password
mysql > UPDATE mysql.user SET password=password('password') WHERE user='root' AND host='localhost';
mysql > FLUSH PRIVILEGES; 

Tuesday, August 11, 2015

How to delete external app from LaunchPad?

  • For external application that displayed at LaunchPad, long click doesn't called up the cross symbol to allow the user to delete away the app.
  • Below are some alternative way that I have come across from internet that might be useful
  • Launch the "Terminal" window
# cd ~/Library/Application\ Support/Dock
# ls
  • By listing the files in the folder, you will be able to find the database file
  • Run the command below to delete away the application from LaunchPad
# sqlite3 [DATABASENAME].db "DELETE from apps WHERE title='[APPNAME]';"

[DATABASENAME] represent the database name that we discovered at previous steps
[APPNAME] represent the name of the app
  • Run the command below to restart the launchpad. Voila, the external application is removed from LaunchPad.
# killall Dock

Monday, August 10, 2015

How to setup "Basic" authentication to phpPgAdmin at Apache web server?


  • Run the command below to add user to ".htpasswd" file


# htpasswd [DIRECTORY]/.htpasswd [USERNAME]

[DIRECTORY] represent the folder that store the password
[USERNAME] represent the user login id

Note: Password/Retype password will be prompted after the command above has been executed


  • Open configuration file httpd.conf , add the configuration as described below

<Directory "/var/www/phpPgAdmin">
    AuthName "Secure Area"
    AuthType Basic
    AuthUserFile [DIRECTORY]/.htpasswd
    require valid-user
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


Restart Apache server, voila, your phpPgAdmin is protected now.