Tuesday, January 09, 2007

Recover Root Password of MYSQL

Step # 1 : Stop mysql service
# /etc/init.d/mysql stop

Step # 2: Start to MySQL server w/o password:
# mysqld_safe --skip-grant-tables &

Step # 3: Connect to mysql server using mysql client:
# mysql -u root

Step # 4: Setup new MySQL root user password
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

Step # 5: Stop MySQL Server:
# /etc/init.d/mysql stop

Step # 6: Start MySQL server and test it
# /etc/init.d/mysql start
# mysql -u root -p

Enjoy ;-)

Monday, January 08, 2007

Recover Root Password In Liunx Machine

Recover Root Password

Probably the simplest way to solve a forgotten root password problem is to boot your system in the single-user mode.
If you are using LILO, at the LILO boot prompt (graphical LILO users can press Ctrl-x to exit the graphical screen and go to the boot: prompt), and then enter:
Code:
linux single
This will make you the "root" user without asking for a password. Once the system has booted, you can change the root password using the password command:
Code:
passwd
GRUB users will follow basically the same steps, except that the GRUB boot loader doesn't have a default boot prompt, but you can choose "e'' when the menu displays to edit the boot parameters. Just select the kernel line for the kernel you want to boot. Go to the end of that line and type "single" as a separate word, then press ENTER to exit the edit mode. Once back at the GRUB screen, press "b" to boot into single user mode.

Friday, January 05, 2007

Backup of DataBase from MYSQL

Every database admin job is to take DB backup time to time.
there is two method's i am using..
Method 1st :
mysqldump client is a backup program used to dump a database or a collection of databases for backup or transfer to another SQL server. The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format.

The most common use of mysqldump is probably for making a backup of an entire database:
shell> mysqldump db_name > backup-file.sql
You can read the dump file back into the server like this:
shell> mysql db_name < backup-file.sql

Or like this:
shell> mysql -e "source /path-to-backup/backup-file.sql" db_name

mysqldump is also very useful for populating databases by copying data from one MySQL server to another:
shell> mysqldump --opt db_name | mysql --host=remote_host -C db_name

It is possible to dump several databases with one command:
shell> mysqldump --databases db_name1 [db_name2 ...] > my_databases.sql

To dump all databases, use the --all-databases option:
shell> mysqldump --all-databases > all_databases.sql
more u can read

Method 2nd:
find out where ur mysql sotre's the database generally default path will be:
:var/lib/mysql this is datadir=var/lib/mysql which is mention in mysql configuration file.

All the DB's u willfind on mysql dir, so u can copy the mysql dir.
this kind of backup used when u want to uninstall and then again install with different version.
simply move to other location mysql dir, and then copy that.

Optimizing the operating system (OS) for MySQL server

 Optimizing the operating system (OS) for MySQL server Optimizing the operating system (OS) for a MySQL server involves configuring various ...