Showing entries 201 to 210 of 1334
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: Linux (reset)
How to use and get output arguments in stored procedure using OUT parameter mode?

It is sometimes required to get the result of a stored procedure in a variable which can be used later or to output the result.

To do so, we can use the "OUT" parameter mode while defining stored procedures.

In the below section, we will be writing a stored procedure to get the square root of a number returned in an output variable provided by us.



Stored Procedure Definition:

Store the below stored procedure in a file named my_sqrt.sql and save it.

DELIMITER $$

DROP PROCEDURE IF EXISTS my_sqrt$$

CREATE PROCEDURE my_sqrt(inp_number INT, OUT op_number FLOAT)
BEGIN
    SET op_number=SQRT(inp_number);

[Read more]
libssl.so.6: cannot open shared object file with Debian/CentOS

Actually, I found this error many times, while installing MySQL/Percona servers with MySQL Sandbox.

To resolve this issue, first, you have to make sure that, SSL is installed /update properly.

sudo apt-get update
sudo apt-get install libssl1.0.0 libssl-dev

After installing this you have to create appropriate link to make it work.

For 32 bit

cd /usr/lib/
sudo ln -s libssl.so.1.0.0 libssl.so.6
sudo ln -s libcrypto.so.1.0.0 libcrypto.so.6

For 64 bit:

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libssl.so.1.0.0 libssl.so.6
sudo ln -s libcrypto.so.1.0.0 libcrypto.so.6

Normally this should work for CentOS and Debian too but If in Debian, it didn’t worked then do this.

sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.6
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.6

I’m sure, it will work.

[Read more]
FATAL: failed to initialize database driver! with Sysnbech 0.4.X

Recently, I came through with this error. It was weird because I have never seen this error earlier.

[root@percona-pxc55-1 nilnandan]# sysbench --test=oltp 
--oltp-table-size=1000000 --mysql-db=dbtest --mysql-user=msandbox 
--mysql-password=msandbox --mysql-socket=/tmp/mysql_sandbox5537.sock 
prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
FATAL: no database driver specified
FATAL: failed to initialize database driver!
[root@percona-pxc55-1 nilnandan]#

After some research, found that with Sysbench 0.4.x, we have to use option –db-driver to make it work. So I have used it and it worked.

[root@percona-pxc55-1 nilnandan]# sysbench --test=oltp 
--oltp-table-size=1000000 --mysql-db=dbtest --mysql-user=msandbox 
--mysql-password=msandbox --mysql-socket=/tmp/mysql_sandbox5537.sock 
--db-driver=mysql --oltp-auto-inc=off prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
Creating table 'sbtest'...
Creating …
[Read more]
How To Install Nginx With PHP And MySQL (LEMP Stack) On CentOS 7

How To Install Nginx With PHP And MySQL (LEMP Stack) On CentOS 7

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a CentOS 6.5 server with PHP support (through PHP-FPM) and MySQL (Mariadb) support.

Ansible: Simple, yet powerful automation

On the company blog I published a post about our experience with Ansible today.

It is no shoot out between different automation tools, but rather a collection of Ansible basics and our experience with it so far. Soon another post will follow about dynamically generated inventories for OpenStack virtual environments.

You can find it here: codecentric blog: Ansible: Simple, yet powerful automation.

How to execute mysql query from a file in your mysql client terminal?

Being a terminal fan myself, I usually find myself running queries in the mysql client instead of a UI interface as it is much faster. You get to see the results instantaneously.

One thing which is pretty tedious is editing a big query again after once running it as the whole multi-line formatted query now appears on a single line, thus reducing its readability.

But no problems, you can edit your query from a file and run the file from your mysql client terminal as many times as you want with as many edits.

To do so, follow the below steps:

1. Open your terminal and cd into the folder you want to store our sample mysql file. Then save your query in a sample file called my_query.sql

$ cd /path/to/folder
$ vim my_query.sql

Save a sample query like:

SELECT * FROM employees
WHERE type LIKE …

[Read more]
How to install Phalcon PHP framework in Ubuntu linux?

Well, we have all heard about the fastest php framework out there. But how do we install it in a Ubuntu Linux machine.

Default process for any linux setup.

Steps:

1. First, we need  a few packages previously installed. To install them, issue the distro specific command in your linux terminal.

For Ubuntu:

sudo apt-get install php5-dev php5-mysql gcc libpcre3-dev

For Fedora:

sudo yum install php-devel php-mysqlnd gcc libtool

For RHEL:

sudo yum install php-devel php-mysql gcc libtool

For Suse:

yast2 -i php5-pear php5-devel php5-mysql gcc

Basically, here we are installing the dev tools we require to compile and setup the Phalcon extension.

2. Get the Phalcon build using git

git …

[Read more]
How To Install Nginx With PHP5 (And PHP-FPM) And MySQL Support On CentOS 6.5

How To Install Nginx With PHP5 (And PHP-FPM) And MySQL Support On CentOS 6.5

Nginx(pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a CentOS 6.5 server with PHP5 support (through PHP-FPM) and MySQL support.

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 14.04LTS (LAMP)

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 14.04LTS (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on anUbuntu 13.04 server with PHP5 support (mod_php) and MySQL support.

Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On OpenSUSE 13.1

Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On OpenSUSE 13.1

Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on an OpenSUSE 13.1 server with PHP5 support (through PHP-FPM) and MySQL support. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. I use PHP-FPM in this tutorial instead of Lighttpd's spawn-fcgi.

Showing entries 201 to 210 of 1334
« 10 Newer Entries | 10 Older Entries »