Allow remote connections to your MySQL server

nano /etc/my.cnf

Now that the file is backed up let’s open this baby up for editing. When you have the file open you are going to want to look for this line:

bind-address = 127.0.0.1

What the above line does is limit connections to the localhost and only the localhost. You want to comment this line out by changing it to:

#bind-address = 127.0.0.1

Now save that file and restart MySQL with the command:

service mysqld restart

mysql -u root -p

Where root is the MySQL administrative user (most like it is root).

You will be prompted for the MySQL administrators password. After you have successfully authenticated you will have a new prompt that looks like:

mysql>

You are now at the MySQL prompt. You only have one command to enter for this to work. You will want to enter this command carefully:

GRANT ALL PRIVILEGES ON *.* TO username@address IDENTIFIED BY “password”;

Where username is the username on the remote machine that will be connecting, address is the IP address of the remote machine, andpassword is the password that will be used by the remote user.

When that command is issued successfully you should see something like:

Query OK, 0 rows affected (0.00 sec)

As long as you get Query OK, you should be good to go.

 

Full Reff: http://www.ghacks.net/2009/12/27/allow-remote-connections-to-your-mysql-server/

Advertisements

How to configure static IP address on CentOS 6.5 minimal

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=xx:xx:xx:xx:xx:xx
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
NM_CONTROLLED=yes
PEERDNS=yes
IPADDR=192.168.0.101
NETMASK=255.255.255.0

Now, configure default getaway:

# vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.0.1

Configure DNS Server

# vi /etc/resolv.conf

; generated by /sbin/dhclient-script
search your_dns-domain-name.com
nameserver 192.168.1.5
nameserver 192.168.1.6

 

 

# /etc/init.d/network restart