We can check how can we able to setting up mysql server with partition enabled. Lets see what is mysql partition means.
A partition is a division of a logical database or its constituting elements into distinct independent parts. Database partitioning is normally done for manageability, performance or availability reasons.
A popular and favourable application of partitioning is in a distributed database management system. Each partition may be spread over multiple nodes, and users at the node can perform local transactions on the partition. This increases performance for sites that have regular transactions involving certain views of data, whilst maintaining availability and security.
The partitioning can be done by either building separate smaller databases (each with its own tables, indices, and transaction logs), or by splitting selected elements.
Follow the steps to install mysql server with partition enabled
First get a package
# gunzip mysql-5.5.12.tar.gz
# tar -xvf mysql-5.5.12.tar
# cd mysql-5.5.12
# mysql-5.5.12 > cmake . -LH
# mysql-5.5.12 > cmake .
# mysql-5.5.12 > make
# mysql-5.5.12 > make install
# cd /usr/local/mysql/
# chown mysql:mysql . -R
# scripts/mysql_install_db --datadir=/usr/local/mysql/data/ --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h systemspfx4 password 'new-password'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
------
create a my.cnf file, here i copied from another system and added the needed parameters including the port which the server want to start.
# scp my.cnf root@IP:/usr/local/mysql/
Start the server
#./bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf &
We can login using
# /usr/local/mysql/bin/mysql -uroot -h 127.0.0.1 -P3307
We can start the server in some other ways also
Start the server in background
# nohup sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf &
Enabled the general log and slow queries
# nohup sh /usr/local/mysql/bin/mysqld_safe --general_log=1 --log-slow-queries=/usr/local/mysql/data/RHEL664PFMX-SLOW.log &
And we can see the server is up and running in port 3307
No comments:
Post a Comment