Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

New Blog - knowaddict.blogspot.com

Going to create a new blog for IT, HowTo, Knowledgebase blog which include windows, linux, mysql, system, network and security.. and whatever related to technology. Separate the learning process with this blog. This blog will be personal life blog..

Feel free to visit...
http://knowaddict.blogspot.com

*thanks to larry for rebooting ur IT mind after 3 years...

Install MySQL in Linux

Step to Install MySQL on RedHat machine.

1. Create directory for MySQL base directory and data directory. This step will easier in future, for add another MySQL version or new Daemon without delete the existing version.
At here, /usr/share/mysql51 will be the base directory, while /var/lib/mysql51 will be data directory.

2. Create a new group and user called mysql, which will used only for restart the mysql engines.

3. Download the MySQL source using wget command.
"wget [MySQL-tar-URL]"

4. Once finished download, tar the file.
"tar zxf [MySQL.tar.gz]"

5. Enter the directory then configure the package. Point the prefix to base diretory location.
"./configure --prefix=/usr/share/mysql51 --with-mysqld-user=mysql"

For MySQL version 5.1 above, some engines does not installed automatic and need to specified in the beginning when do compilation. For example, If need to add engines innobase, partition and federated, run the configure with.
"./configure --prefix=/usr/share/mysql51 --with-mysqld-user=mysql --with
plugins=innobase,partition,federated"

Once compile success, will see the message as below.


6. "make && make install"

Message when make and make install success.

7. Copy the my-medium.cnf file to /etc directory. Choose the my.cnf file according to the server specification.
"cp ./support-files/[my-type.cnf] /etc/my.cnf"
8. Edit the my.cnf file

Change the socket location, will be useful when have multiple daemon running.
Add new variable datadir which point to the data directory created.
Change and add any necessary variables.

9. Change to MySQL base directory and install mysql db
"/usr/share/mysql51/bin/mysql_install_db --user=mysql"

Message show once the install db success. Check any error appear which indicate the wrong setting appear in the my.cnf.


10. Change the ownership on the basedir and datadir.
"chown -R root:mysql [basedir]"
"chown -R mysql:mysql [datadir]"

11. Start the mysql with point the defaults-file to the my.cnf location.
"/usr/share/mysql51/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql &"

12. Access to MySQL with command and set password for MySQL root user.
"/usr/share/mysql51/bin/mysql -u[user] -p -h[host] -P[port]"
"SET PASSWORD FOR root@localhost=PASSWORD('[password]');"

Configure Static IP on Ubuntu

I been used with RedHat for quite long time.. But when I first touch Ubuntu, I have a lot difficulty to adapt with it. File system location had been slightly changes but overall is easier than RedHat. Due to Ubuntu can easily install any package you prefer without searching "howto" or "sop" at google.

Suddenly I face some difficulty in Ubuntu.. HOW TO CONFIGURE STATIC IP..
Shitzzz... I not even know where the interfaces config file locate. HAHA XDD

Anyway.. I found the way and here it go:

1. Edit the interface config file which located at "/etc/network/interfaces".

File to edit Interfaces Settings

2. If the network interface is not configure with static IP, the config file will be as below.

Defaults Interfaces Config

3. To make static IP. Edit the file and change the "dhcp" to "static". Then add few new value to the config file as below.

Change DHCP to Static Settings

4. Once done, save the config and restart the network with "sudo /etc/init.d/networking restart"

Restart Network

5. Remember to set the DNS for the server. To set DNS, edit the resolv.conf file.

File name for edit DNS Server IP

6. Follow by "nameserver", type the DNS Server IP. Just add as many DNS Server as you like. Then save the file.

Add DNS Server IP

That all the step to configure Ubuntu IP Address.


For some user, they may prefer to configure a secondary IP to their server. With the same step, edit the "/etc/network/interfaces". Add the secondary IP setting at the bottom.

Add secondary IP Address (eth0:1)

Then restart the network. Everything will work perfectly.

Enable Syntax Highlight in Ubuntu

In Ubuntu, it is hard to read config, code, file when the syntax is turn off or all in black and white. To enable the syntax, you can type ":syntax on" at the file

If there is an error appear when type syntax on"

You need reinstall the vim again with the commandThen retype ":syntax on" . It should be work now.


If not happy and do not want always type "syntax on". Set it as permanent with follow the steps:

  1. edit the /etc/vimrc file. If no privileges to edit, use sudo command
  2. add the line "syntax on" at the file
  3. save and everything will be in colour

Xen Server

Nowadays, virtual machine been used moderate for testing and development. Last few years, I had tested xen server function at my working place. Found out, it is an interesting software or technology especially when doing virtual machine.

Now I try to rebuild the xen server with 2 virtual machine (Windows 2003 and RedHat). Found out there will be no problem to create RedHat as VM in xenserver. But there is problem with windows 2003. There is a limitation you need. For Windows Server, your server must support VT(Virtual Technology). If your processor not support, then no luck but need use third party software. The VT can be enabled in Bios.

From my experience, for a better usage on both VM. It wiser to enable vnc or remote desktop services due to the console is quite slow and small. Beside, the download by both VM seem slower. Maybe due to 1 NIC is shared by 3 hosts.

Besides that, everything seem running well. Now only need someone do some test running on the xen server.