Posts Tagged ‘MySQL’

Assalamualaikum,

Aida saya dah jumpa cara senang nak recover root password utk freebsd @ Linux :
Step 1 = Stop mysql
 
Freebsd = /usr/local/rc.d/mysql-server stop
Ubuntu / Debian = /etc/init.d/mysql stop
 
Step 2 = start mysql data 
 
Freebsd : /usr/local/rc.d/mysql-server –skip-grant-tables &
Ubuntu / Debian = /usr/sbin/mysqld –skip-grant-tables –skip-networking &
 
Step 3 = Login Mysql
 
Freebsd = mysql -u root mysql
Ubuntu / Debian = mysql -u root
 
Step 4 : Change Password
 
** Utk root yg bleh access database online i.e.:  Muamalat
 
mysql> FLUSH PRIVILEGES;
mysql> UPDATE mysql.user SET Password=PASSWORD(‘newpwd’) WHERE User=‘root’;
 
** Utk Mysql biasa i.e: Arrahn
 
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR root@‘localhost’ = PASSWORD(‘password’);
 
Step 5 : kill mysql
 
killall mysqld 
 
issue command ni “ps aux | grep mysql”
dapatkan PID kemudian kill PID “killall PID”
 
CTH : 

msyamsuris-iMac:~ msyamsuri$ ps aux | grep mysql

msyamsuri        2866   0.0  0.0  2432772    664 s000  S+    8:08PM   0:00.00 grep mysql

2866 <– PID No

Step 6 : hidupkan semula mysql

Freebsd = /usr/local/rc.d/mysql-server strt
Ubuntu / Debian = /etc/init.d/mysql start

OK sekian utk Tutorial . 

** Email to mysq X-staff fine simple solutions for mysql root recovery.

Mysql huge databases Server, cut n paste

———————–cut here —————————–

[mysqld]
local-infile=0
skip-locking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1
skip-innodb
skip-bdb
log-slow-queries
skip_name_resolve

[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

———————–cut here —————————–