Monday, July 25, 2011
Weather Report
Nevertheless, to be on the safe side, he replied to his Tribe that the winter was indeed going to be cold and that the members of the village should collect wood to be prepared.
But also being a practical leader, after several days he got an idea. He went to the phone booth, called the National Weather Service and asked 'Is the coming winter going to be cold?'
'It looks like this winter is going to be quite cold indeed,'the weather man Responded.
So the Chief went back to his people and told them to collect even more wood. A week later, he called the National Weather Service again. 'Is it going to be a very cold winter?'
'Yes,' the man at National Weather Service again replied, 'It's definitely going to be a very cold winter.'
The Chief again went back to his people and ordered them to collect every scrap of wood they could find. Two weeks later, he called the National Weather Service again. 'Are you absolutely sure that the winter is going to be very cold?'
'Absolutely,' The Man replied. 'It's going to be one of the coldest winters ever..''
'How can you be so sure?' the Chief asked.
The weatherman replied, 'The Red Indians are collecting wood like Crazy!!!'
Friday, July 22, 2011
Reset MySQL Root Password
Resetting the root password of a MySQL database is trivial if you know the current password if you don't it is a little tricker. Thankfully it isn't too difficult to fix, and here we'll show one possible way of doing so.
If you've got access to the root account already, because you know the password, you can change it easily:
steve@steve:~$ mysql --user=root --pass mysql Enter password: mysql> update user set Password=PASSWORD('new-password-here') WHERE User='root'; Query OK, 2 rows affected (0.04 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.02 sec) mysql> exit Bye
However if you don't know the current password this approach will not work - you need to login to run any commands and without the password you'll not be able to login!
Thankfully there is a simple solution to this problem, we just need to start MySQL with a flag to tell it to ignore any username/password restrictions which might be in place. Once that is done you can successfully update the stored details.
First of all you will need to ensure that your database is stopped:
root@steve:~# /etc/init.d/mysql stop
Now you should start up the database in the background, via the mysqld_safe command:
root@steve:~# /usr/bin/mysqld_safe --skip-grant-tables & [1] 6702 Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[6763]: started
Here you can see the new job (number "1") has started and the server is running with the process ID (PID) of 6702.
Now that the server is running with the --skip-grant-tables flag you can connect to it without a password and complete the job:
root@steve:~$ mysql --user=root mysql Enter password: mysql> update user set Password=PASSWORD('new-password-here') WHERE User='root'; Query OK, 2 rows affected (0.04 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.02 sec) mysql> exit Bye
Now that you've done that you just need to stop the server, so that you can go back to running a secure MySQL server with password restrictions in place. First of all bring the server you started into the foreground by typing "fg", then kill it by pressing "Ctrl+c" afterwards.
This will now allow you to start the server:
root@steve:~# /etc/init.d/mysql start Starting MySQL database server: mysqld. Checking for corrupt, not cleanly closed and upgrade needing tables..
Now everything should be done and you should have regained access to your MySQL database(s); you should verify this by connecting with your new password:
root@steve:~# mysql --user=root --pass=new-password-here Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 5.0.24a-Debian_4-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> exit Bye
Thursday, July 21, 2011
Audit
The young man parks the car, connects his laptop to the mobile-fax, enters a NASA Website, scans the ground using his GPS, opens a database and 60 Excel tables filled with algorithms and pivot tables. He then prints out a 150-page report on his high-tech mini-printer, turns to the shepherd and says "You have exactly 1,586 sheep." The shepherd cheers, "That's correct, you can have your sheep." The young man takes one of the animals from the flock and puts it in the back of his Porsche.
The shepherd looks at him and asks, "If I guess your profession, will you return my animal to me?" The young man answers, "Yes, why not?" The shepherd says, "You are an auditor." "How did you know?" asks the young man. "Very simple", answers the shepherd. "First, you came here without being wanted. Secondly, you charged me a fee to tell me something I already knew. Thirdly, you don't understand anything about my business..... Now can I have my dog back?"