Jan 15 2009

How to reset MySQL root Password

Here is how you can reset forgotten root password,
Be aware that following will reset your root password:

# /etc/init.d/mysql stop
# /usr/bin/mysqld_safe –skip-grant-tables –skip-networking &
# mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD(“your password here”) WHERE User=”root”;
mysql> exit

# /etc/init.d/mysql stop
# /etc/init.d/mysql start

Pay attention that, mysql can be in different folders depending on the installation, for different linux version the way you can start or stop the mysql can very.

For fedora or CentOS:
#service mysqld start
#service mysqld stop
etc..

Jan 11 2008

MySQL Tuner

After coming back from the FOSS Meetup, I’m try to study and implement it to my mysql server ….

I haven’t get the slide from the Collin Charles presentation at the FOSS Meetup but then i try to seek some mysql tools out there … while chat in #rawpacket in freenode … enhanced & dakrone suggesting mysqltuner to tune my mysql … then i  download it and give a test run …

here are the output :

[fenris@gateway mysqltuner]$ perl mysqltuner.pl
MySQL High-Performance Tuning Script – Major Hayden <major@mhtx.net>
Bug reports, feature requests, and downloads at http://mysqltuner.com/
Run with ‘–help’ for additional options and output filtering
Please enter your MySQL login: root
Please enter your MySQL password:
[!!] Your MySQL version 4.1.12-standard is EOL software!  Upgrade soon!
[OK] Operating on 32-bit architecture with less than 2GB RAM
——– General Statistics ————————————————–
[**] Up for: 111d 2h 16m 32s (4M q [0.431 qps], 125K conn, TX: 3G, RX: 627M)
[**] Reads / Writes: 86% / 14%
[**] Total buffers per thread: 2.6M
[**] Total global buffers: 34.0M
[OK] Maximum possible memory usage: 296.1M (60% of installed RAM)
[OK] Slow queries: 0%
[OK] Highest usage of available connections: 11%
[!!] Cannot calculate MyISAM index size – re-run script as root user
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0%
[!!] Joins performed without indexes: 51736
[!!] Temporary tables created on disk: 47%
[!!] Thread cache is disabled
[!!] Table cache hit rate: 0%
[OK] Open file limit used: 12%
[OK] Table locks acquired immediately: 99%
[!!] InnoDB log size is 5.0M (62.5% of InnoDB buffer pool)
——– Recommendations —————————————————–
General recommendations:
Enable the slow query log to troubleshoot bad queries
Adjust your join queries to always utilize indexes
Be sure that tmp_table_size/max_heap_table_size are equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Set thread_cache_size to 4 as a starting value
Increase table_cache gradually to avoid file descriptor limits
Set innodb_log_file_size to 25% of InnoDB buffer pool
Variables to adjust:
query_cache_size (>= 8M)
join_buffer_size (> 128.0K, or always use indexes with joins)
tmp_table_size (> 32M)
max_heap_table_size (> 16M)
thread_cache_size (start at 4)
table_cache (> 64)
innodb_log_file_size (2.0M, which is 25% of InnoDB buffer pool)

After looking that output & the meetup ….. i need to play attention & deeper my knowledge for administer the mysql server …. until i learn more about benchmarking, tuning n etc …. and i’m saying to myself .. “WELCOME to MySQL World”  while previously im not aware about this stuff ….. then again thanks to guys & community given me some awareness !!!

I might do something to my mysql server by referring the recommendation … sooner i might running and learn the ab tools …


Get Adobe Flash playerPlugin by wpburn.com wordpress themes