Skip to main content

Posts

Showing posts from January, 2011

Tips Recover MySQL root Password

One day i forgot myql root user password. Then i found simple steps to change it without reinstall mysql server. 1. Open console and stop mysql service #/etc/init.d/mysqld stop 2. Then i run this service without password #mysqld_safe --skip-grant-tables you can run it as a background if you would not use another console (shell) #mysqld_safe --skip-grant-tables & 3. Then i open another console and connect to mysql #mysql -u root output mysql> 4. Next, i setup new password for root user mysql> use mysql; mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; mysql> flush privileges; mysql> quit 5. Last step is stop mysql service #/etc/init.d/mysqld stop 6. Finish, and start mysqld and test new password #/etc/init.d/mysqld start #mysql -u root -p

Install DHCP Server

Last week i need to install dhcp on my server. My server use Linux Ubuntu 8.04 as an operating system. These are the steps : 1. Install DHCP3 Server sudo apt-get install dhcp3-server 2. Edit Configuration of DHCP sudo nano /etc/dhcp3/dhcpd.conf This is the configuration of /etc/dhcpd.conf # Sample /etc/dhcpd.conf # (add your comments here) default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option routers 192.168.1.254; option domain-name-servers 192.168.1.1, 192.168.1.2; option domain-name "mydomain.example"; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.100; range 192.168.1.150 192.168.1.200; } Save this configuration using Ctrl+O and Exit using Ctrl+X. This configuration will result in the DHCP server giving a client an IP address from the range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will lease an IP address for 600 seconds if the client doesn't ask for