Category Archives: News

Change MySQL root Password

Change MySQL root Password

Method #1: Use mysqladmin command to change root password

If you have never set a root password for MySQL server, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows: $ mysqladmin -u root password NEWPASSWORD However, if you want to change (or update) a root password, then you need to use the following command: $ mysqladmin -u root -p'oldpassword' password newpass For example, If the old password is abc, you can set the new password to 123456, enter:
$ mysqladmin -u root -p'abc' password '123456'

Method #2: Changing MySQL root user password using mysql command

This is an another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update or change the password using the...

How to Add New Hard disk to Linux Machine

How to Add New Hard disk to Linux Machine  I am going to divide each part as follows 1. Plan the layout of the filesystem with the new drive 2. Partition the new hard drive 3. Format the new partitions 4. Test the new space 5. Copy data from old to new partition (optional) 6. Edit /etc/fstab 7. Reboot 8. Remove old data (optional) Here is the details about each one. 1. Plan the new filesystem. Where would you like to use the new space? Do df to print a summary of free/used space on each of the existing mounted partitions. Do du on selected directories to find their size. For example, I would consider using new hard drive space in...

Delete Files Older Than x Days on Linux

Delete Files Older Than x Days on Linux The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.   Command Syntax
find /path/to/files* -mtime +5 -exec rm {} \;
Note that there are spaces between rm, {}, and \; Explanation
  • The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results.
  • The second argument, -mtime, is used to specify the number of days...