Search This Blog

Lets go..




Manage your Inventory | Grow your restaurant business | Manage your Employee | Control your accounts
Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Thursday

How to establish MySQL remote connection

Bind your ip address ::
[root@db-tom ~]# vim /etc/my.cnf
Add bind-address = 10.12.21.11 (your machine ip address) in my.cnf file

Note : your network must have static private ip (not DHCP) in case of private network or public ip

mysql -uroot -p
password:*******
use mysql;
mysql> GRANT ALL PRIVILEGES ON *.* TO  'USERNAME'@'%'  IDENTIFIED  BY  'PASSWORD';
mysql>FLUSH PRIVILEGES;
mysql>exit

[root@db-tom ~]# /etc/init.d/iptables start
[root@db-tom ~]# chkconfig iptables off

How to install MySQL in CentOS 6

Just run these commands ::
[root@db-tom ~]# yum install wget
[root@db-tom ~]# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
[root@db-tom ~]# yum localinstall mysql57-community-release-el6-7.noarch.rpm
[root@db-tom ~]# yum repolist enabled | grep "mysql.*-community.*"
[root@db-tom ~]# yum install mysql-community-server
[root@db-tom ~]# service mysqld start
[root@db-tom ~]# grep 'temporary password' /var/log/mysqld.log
[root@db-tom ~]# mysql_secure_installation

Note : New password must have one capital letter+one special character+one number+one small letter

MySQL start/stop ::
[root@db-tom ~]# /etc/init.d/mysqld stop
[root@db-tom ~]# /etc/init.d/mysqld start
[root@db-tom ~]# /etc/init.d/mysqld restart
[root@db-tom ~]# /etc/init.d/mysqld status