0% found this document useful (0 votes)
282 views

Installing MySQL-python RPM

The document details the steps to install Openark kit and its dependencies on a Red Hat Linux server. It searches for and installs MySQL-python and MariaDB-shared using yum. It then downloads the Openark rpm, installs it, and adds the binaries to the PATH. Finally, it checks the help for the oak-chunk-update command provided by Openark kit.

Uploaded by

Stephen Efange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
282 views

Installing MySQL-python RPM

The document details the steps to install Openark kit and its dependencies on a Red Hat Linux server. It searches for and installs MySQL-python and MariaDB-shared using yum. It then downloads the Openark rpm, installs it, and adds the binaries to the PATH. Finally, it checks the help for the oak-chunk-update command provided by Openark kit.

Uploaded by

Stephen Efange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

[root@tpamaria4 sefange]# yum search MySQL-python

Loaded plugins: fastestmirror, langpacks, rhnplugin


This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
============================================== N/S matched: MySQL-python
===============================================
MySQL-python.x86_64 : An interface to MySQL

Name and summary matches only, use "search all" for everything.
[root@tpamaria4 sefange]# clear
[root@tpamaria4 sefange]# yum search MySQL-python
Loaded plugins: fastestmirror, langpacks, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
============================================== N/S matched: MySQL-python
===============================================
MySQL-python.x86_64 : An interface to MySQL

Name and summary matches only, use "search all" for everything.
[root@tpamaria4 sefange]# cd /opt/
[root@tpamaria4 opt]# ll
total 0
drwxr-xr-x. 2 root root 6 Mar 26 2015 rh
drwxr-x---. 5 root root 80 Mar 10 14:49 spclient
[root@tpamaria4 opt]# wget https://storage.googleapis.com/google-code-archive-
downloads/v2/code.google.com/openarkkit/openark-kit-196-1.noarch.rpm
--2017-04-14 13:49:01-- https://storage.googleapis.com/google-code-archive-
downloads/v2/code.google.com/openarkkit/openark-kit-196-1.noarch.rpm
Resolving storage.googleapis.com (storage.googleapis.com)... 173.194.215.128,
2607:f8b0:400c:c0c::80
Connecting to storage.googleapis.com (storage.googleapis.com)|
173.194.215.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 36974 (36K) [application/octet-stream]
Saving to: openark-kit-196-1.noarch.rpm

100%
[==============================================================================>]
36,974 --.-K/s in 0.03s

2017-04-14 13:49:01 (1.07 MB/s) - openark-kit-196-1.noarch.rpm saved


[36974/36974]

[root@tpamaria4 opt]#
[root@tpamaria4 opt]# rpm -ivh openark-kit-196-1.noarch.rpm
Preparing... ################################# [100%]
Updating / installing...
1:openark-kit-196-1 ################################# [100%]
[root@tpamaria4 opt]# yum install MySQL-python
Loaded plugins: fastestmirror, langpacks, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
mariadb
| 2.9 kB 00:00:00
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package MySQL-python.x86_64 0:1.2.5-1.el7 will be installed
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for
package: MySQL-python-1.2.5-1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: MySQL-python-
1.2.5-1.el7.x86_64
--> Running transaction check
---> Package MariaDB-shared.x86_64 0:10.1.22-1.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
=====================================
Package Arch Version
Repository Size
===================================================================================
=====================================
Installing:
MySQL-python x86_64 1.2.5-1.el7 centos-
database_cent7_x86_64 90 k
Installing for dependencies:
MariaDB-shared x86_64 10.1.22-1.el7.centos mariadb
1.3 M

Transaction Summary
===================================================================================
=====================================
Install 1 Package (+1 Dependent package)

Total download size: 1.4 M


Installed size: 6.7 M
Is this ok [y/d/N]:

Is this ok [y/d/N]: y
Downloading packages:
(2/2): MySQL-python-1.2.5-1.el7.x86_64.rpm
| 90 kB 00:00:00
MariaDB-10.1.22-centos7-x86_64-shared.rpm
| 1.3 MB 00:00:00
-----------------------------------------------------------------------------------
-------------------------------------
Total
2.2 MB/s | 1.4 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 6 pre-existing rpmdb problem(s), 'yum check' output follows:
nagios-plugins-mysql-2.1.4-2.el7.x86_64 has missing requires of
libmysqlclient.so.18()(64bit)
nagios-plugins-mysql-2.1.4-2.el7.x86_64 has missing requires of
libmysqlclient.so.18(libmysqlclient_18)(64bit)
1:net-snmp-5.7.2-24.el7_2.1.x86_64 has missing requires of libmysqlclient.so.18()
(64bit)
1:net-snmp-5.7.2-24.el7_2.1.x86_64 has missing requires of mysql-libs
2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
2:postfix-2.10.1-6.el7.x86_64 has missing requires of
libmysqlclient.so.18(libmysqlclient_18)(64bit)
Installing : MariaDB-shared-10.1.22-1.el7.centos.x86_64
1/2
Installing : MySQL-python-1.2.5-1.el7.x86_64
2/2
Verifying : MariaDB-shared-10.1.22-1.el7.centos.x86_64
1/2
Verifying : MySQL-python-1.2.5-1.el7.x86_64
2/2

Installed:
MySQL-python.x86_64 0:1.2.5-1.el7

Dependency Installed:
MariaDB-shared.x86_64 0:10.1.22-1.el7.centos

Complete!
[root@tpamaria4 opt]#

Add the openark-kit-196-1 binaries to $Path

[root@tpamaria4 opt]# export PATH="/usr/local/bin:$PATH"


[root@tpamaria4 opt]# oak-chunk-update --help
Usage: oak-chunk-update [options]

Options:
-h, --help show this help message and exit
-u USER, --user=USER MySQL user
-H HOST, --host=HOST MySQL host (default: localhost)
-p PASSWORD, --password=PASSWORD
MySQL password
--ask-pass Prompt for password
-P PORT, --port=PORT TCP/IP port (default: 3306)
-S SOCKET, --socket=SOCKET
MySQL socket file. Only applies when host is localhost
--defaults-file=DEFAULTS_FILE
Read from MySQL configuration file. Overrides all
other options
-d DATABASE, --database=DATABASE
Database name (required unless query uses fully
qualified table names)
-e EXECUTE_QUERY, --execute=EXECUTE_QUERY
Query to execute, which contains a chunk placeholder
in the form of OAK_CHUNK(table_name) (required)
-c CHUNK_SIZE, --chunk-size=CHUNK_SIZE
Number of rows to act on in chunks (default: 1000). 0
means all rows updated in one operation
--start-with=START_WITH
Assuming chunking on numeric field (e.g.
AUTO_INCREMENT), start chunking from this value and
onward. Either provide a constant or a query returning
a single integer value.
--end-with=END_WITH Assuming chunking on numeric field (e.g.
AUTO_INCREMENT), end chunking with this value. Either
provide a constant or a query returning a single
integer value.
--terminate-on-not-found
Terminate on first occurrence where chunking did not
affect any rows (default: False)
--force-chunking-column=FORCED_CHUNKING_COLUMN
Columns to chunk by; avoids querying in
INFORMATION_SCHEMA. Format: either column_name:type,
where type is integer/text/temporal - for single
column keys, or column1_name,column2_name,... for one
or more column keys, with no type.
--skip-lock-tables Do not issue a LOCK TABLES READ. May be required when
using queries within --start-with or --end-with
--skip-retry-chunk Avoid retrying a chunk operation on error. Default:
false
--no-log-bin Do not log to binary log (actions will not replicate)
--sleep=SLEEP_MILLIS Number of milliseconds to sleep between chunks.
Default: 0
--sleep-ratio=SLEEP_RATIO
Ratio of sleep time to execution time. Default: 0
--debug Print stack trace on error
-v, --verbose Print user friendly messages
--print-progress Redundant. Use --verbose instead
[root@tpamaria4 opt]#

echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile

Installing in REL and Prod

Install Openark kit and its pre-requisites MySQL-python, MariaDB(MySQL)-shared.


Then use oak-chunk-update to perform the updates of the associated batch request.

yum search MySQL-python

yum install MySQL-python

wget https://storage.googleapis.com/google-code-archive-
downloads/v2/code.google.com/openarkkit/openark-kit-196-1.noarch.rpm

rpm -ivh openark-kit-196-1.noarch.rpm

echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile


source ~/.bash_profile

oak-chunk-update --help

You might also like