Open MySQL Port 3306 in CentOS 7

To allow MySQL to connect from remote server on CentOS 7 server, you need to enable port 3306 in firewall.

To do this, edit file

Find

Add above

Restart server.

Install python 3.6 on CentOS 7

CentOS 7 come with Python 2.7. To install python 3.6, first install EPEL repo.

Install IUS repo.

https://ius.io/GettingStarted/

For CentOS 7, run

Now you can install python 3.6 with yum

Python 3.6 binary will be available as “python3.6” and “pip3.6”

Install Python 2.7 on CentOS 6

CentOS 6 comes with python 2.6, to install python 2.7, first install gcc and dependencies yum

Download latest Python 2.7 from

https://www.python.org/downloads/

For Python 2.7.2 (latest at the time of writing this post).

We use “make altinstall” so python will be installed as python2.7. If you do “make install”, it replace system python binary and break CentOS.

Install pip

Install memcached on CentOS 7

To install memcached on CentOS 7, run

Set memcached to start on boot

Start memcached with

Installing PHP Module

You need remi repository installed, that provide memcached module for all versions of php they support.

For PHP 5.6, run

Now phpinfo() will show

centos 7 php memcache

See memcached

Adding IP Range in CentOS 6

To add an IP range in CentOS 6 server, create file

Add

Replace IP with your actual start and end IP.

Restart network service with

Install MySQL 8 on CentOS, RHEL 6/7

To Add MySQL yum repository to your server, go to

https://dev.mysql.com/downloads/repo/yum/

Download the rpm file available.

For RHEL/CentOS 7

For RHEL/CentOS 6

Installing MySQL Server

Stop/Start MySQL

To stop/start MySQL, use service name “mysqld”.

MySQL 8 root Password

When MySQL first starts, it create a random password and store in MySQL log file. To find the MySQL root password, run

This default password don’t allow you to do anything, so login to MySQL with this password and set a secure password for root.

MYSQL_ROOT_PASSOWRD – replace it with you secure new MySQL root password.

Installing Older Version of MySQL

When you add MySQL repository, it activate latest version by default. If you want older version, say 5.7, you need to activate it.

To see available repository, run

To disable MySQL 8 repository, run

To enable MySQL 5.7 repository, run

Now installing MySQL server will install MySQL 5.7 instead of latest version.

MySQL CentOS

chkconfig

chkconfig is a command available in CentOS 6 to set a service start on boot.

To start lighttpd on boot run.

chkconfig command list all services and its run levels.