Innodb Exersice
Innodb Exersice
----------------------------------------------------
Task 1 :- Change old location to new location
1,Shutdown server
---verify the location
show variables like 'innodb_data_home_dir';
2,update my.cnf , add new location
[mysqld]
innodb_data_home_dir = /var/lib/mysql/idata
3,copy the files to new location
root@ip-172-31-34-92:/var/lib/mysql# mv ibdata1 idata/
4, verify the owner permissions , Give proper permissions for that new path
chown -R mysql:mysql /var/lib/mysql/idata
5,Restart server / Server start
6,mysql> show variables like 'innodb_data_home_dir';
-----------------------------------------------------------------------------------
---------
CR:- Increase the log files with 4 and change the location.
Task 7:-
CR:- Turn off innodb Storage Engine to Myisam Engine
1,Shutdown Server
2,update my.cndf
[mysqld]
skip-innodb
default-storage-engine=MyISAM
3,Restart server / Server start
4,show engines;
-------------------
Task
switch of file per table , Not Recommeneded
Mysql> show variables like 'innodb_file_per_table';
shutdown normal;
Dynamic Parameter
------------------------------------------------------------------------
mysql> show variables like 'innodb_fast_shutdown';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| innodb_fast_shutdown | 1 |
+----------------------+-------+
By default, the value is 1, which causes a “fast” shutdown (the normal type of
shutdown).
If the value is 0, InnoDB does a full purge [removal] and an insert buffer merge
before a shutdown.
These operations can take minutes, or even hours in extreme cases.
If the value is 2, InnoDB will just flush its logs and then shut down cold, as if
MySQL had crashed;
no committed transaction will be lost, but crash recovery will be done at the next
startup.
mysql> show variables like 'innodb_fast_shutdown';