Linux OS

Untitled-2

Configuring MySQL To Start At Boot Up

One of the cornerstones of MySQL installation is enabling automatic startup with server boot up. This is important if are have many services running under a server and have many servers for that matter.

Assumption

CentOS Linux 5

MySQL 5

Shell Access / PuTTY / Console Access

Step 1 SSH To Linux Server And Switch User To Root

SSH to your Linux Server and switch user to root

#su -

Step 2 Check Config For mysqld Run Level

#chkconfig –list mysqld

As you may see from chkconfig, mysqld is off for run levels 1 to 6. We need to turn it on for 2, 3, 4, and 5.

Step 3 Turn On Run Level For 2, 3, 4, 5

#chkconfig –level 2345 mysqld on

Done, next, ensure that mysqld is turned on by issuing the chkconfig –list mysqld command again.

#chkconfig –list mysqld


mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off


Share
Oracle 11g on CentOS 5.5-2010-10-11-12-30-01

Assign Static IP Address On CentOS (and RHEL / Most Linux)

This guide is especially useful for Linux operating system “Testers” who have installed Linux in a virtual machine for environment testing purposes, these people (like me) quite often have to bring down the operating system once a day.
Assigning a static IP to your virtual machine helps to eliminate the mandune steps of going into your Linux box each time to retrieve the IP address (#ifconfig) before you could use putty (or various other SSH software) from the outside (host machine, usually your windows xp/7/vista) to go in to the guest OS (which is what most people conveniently do in place of using the console provided by the respective virtualization provider).
This guide assumes you have are using the command method to administrate your Linux box, have root access and have a fair bit of command knowledge (you are fine if you are able to do basic cd, ls or mv). If you are using the X Window function such as GNOME or KDE, fire up your terminal. (Start > Application > Terminal)
For VM users, if you have the chance to do a snapshot before you begin this guide to configure static IP for your Linux box, do so, because chances are if you make a mistake, you would want to conveniently “revert” to the last working snapshot. For remote users, please be warned that if you run the risk of having to make a beeline for your data center to reboot or console in should you make a mistake.
If you are following this guide on a spare desktop machine that within your reach, or non critical systems, then you have little to worry about. Please do not try this on a production/live/through remote means if it is your first time. You may be disconnected straight away from your Linux machine.
Step 1 Login to your Linux shell
Login to your Linux shell, then switch to root user (su -), you will be prompted for your password.
#ssh root@localhost
or
#ssh ken@yourdomain.com
or
#ssh yourdomain.com

Step 2 Change directory to /etc/sysconfig/networking/devices/

Change directory to /etc/sysconfig/networking/devices/, this is where your network interfaces are.

#cd /etc/sysconfig/networking/devices/

Step 3 List all the network interfaces in the directory (use command ls -la or ll or ls or ls -l)

List all the network interfaces in the directory, usually, one.
#ls -la
You should see the following:
Step 4 Edit the network interface file ifcfg-eth0
Edit the network interface file ifcfg-eth0 using your preferred text editor.
We use VI to edit the file.
vi ifcfg-eth0
You should see this:
Step 5 Make changes to the network interface file
Modify those in bold only. Some attributes may differ, do not change them unless you are absolutely sure about what they do.
Change the IPADDR (192.168.64.121) to your desirable IP address.
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:9C:23:DE:92:8C
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.64.121
GATEWAY=192.168.0.1
Step 6 Save and exit text editor
In VI, press <esc> key, and type in ” :wq ” followed by pressing the <enter> key.
Step 7 Reload the network card
#ifdown eth0 && ifup eth0
Done. Your static IP will take effect!
Share
  • Newsflash

    March 2012: We have change our site theme to F2.
  • Who's Online

    9 visitors online now
    9 guests, 0 members
    Powered by Visitor Maps