blog menu1

MySQL-Commands Used

My SQL commands used...

1. Connect to DB - mysql -u root -p'abcdefg'
2. use mysql;
3. create user 'abc'@'abc.uk' identified by 'jramster';
4. grant create on mysql.* to ''abc'@'abc.uk'
org.uk' ;
5. FLUSH PRIVILEGES;
6. GRANT ALL PRIVILEGES ON *.* to 'abc@abc.uk' ;

7. SELECT User,Password,Host from user;

8. Check Version of MYSQL DB -
mysql –version

9. show status like 'Innodb_buffer%' ;
10. show status like 'Qc%' ;
11. create index idx ON TAB1(col1,col2,col3) ;
12. Show create table tabname ;

13.. mysql> use ipplan;

14. mysql> CREATE TABLE LOCAL_AUTHORITIES (La_code_new VARCHAR(10), La_code_old VARCHAR(4), NAME VARCHAR(50));

Query OK, 0 rows affected (0.07 sec)
mysql>

15. mysql> LOAD DATA LOCAL INFILE '/nfshome/kacholed/LA_UA.csv' into table LOCAL_AUTHORITIES FIELDS TERMINATED BY '|' LINES TERMINATED BY '\r\n';

Query OK, 407 rows affected, 1219 warnings (0.00 sec)

Records: 407 Deleted: 0 Skipped: 0 Warnings: 1219

16. mysql> select count(1) from LOCAL_AUTHORITIES;

| count(1) |

| 407 |

1 row in set (0.00 sec)

17. show variables; -- For SHOW VARIABLES, if you specify neither GLOBAL nor SESSION, MySQL returns SESSION values.
18. show engines;
19. SHOW GLOBAL STATUS;
20. INSTALL PLUGIN myplugin SONAME 'somepluglib.so'; -- TO INSTALL PLUGIN




InnoDB is a storage engine for MySQL, included as standard in all current binaries distributed by MySQL AB. Its main enhancement over other storage engines available for use with MySQL is ACID-compliant transaction support
MyISAM is the default storage engine for the MySQL relational database management system versions prior to 5.5 1. It is based on the older ISAM code but has many useful extensions. The major deficiency of MyISAM is the absence of transactions support. Versions of MySQL 5.5 and greater have switched to the InnoDB engine to ensure referential integrity constraints, and higher concurrency.



InnoDB is a transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data. InnoDB row-level locking (without escalation to coarser granularity locks) and Oracle-style consistent nonlocking reads increase multi-user concurrency and performance. InnoDB stores user data in clustered indexes to reduce I/O for common queries based on primary keys. To maintain data integrity, InnoDB also supports FOREIGN KEY referential-integrity constraints. You can freely mix InnoDB tables with tables from other MySQL storage engines, even within the same statement.

To determine whether your server supports InnoDB use the - SHOW ENGINES statement.


InnoDB has been designed for maximum performance when processing large data volumes. Its CPU efficiency is probably not matched by any other disk-based relational database engine.The InnoDB storage engine maintains its own buffer pool for caching data and indexes in main memory. InnoDB stores its tables and indexes in a tablespace, which may consist of several files (or raw disk partitions). This is different from, for example, MyISAM tables where each table is stored using separate files. InnoDB tables can be very large even on operating systems where file size is limited to 2GB.

The Windows Essentials installer makes InnoDB the MySQL default storage engine on Windows, if the server being installed supports InnoDB.

InnoDB is used in production at numerous large database sites requiring high performance. The famous Internet news site Slashdot.org runs on InnoDB. Mytrix, Inc. stores more than 1TB of data in InnoDB, and another site handles an average load of 800 inserts/updates per second in InnoDB.

InnoDB is published under the same GNU GPL License Version 2 (of June 1991) as MySQL.

InnoDB Hot Backup enables you to back up a running MySQL database, including InnoDB and MyISAM tables, with minimal disruption to operations while producing a consistent snapshot of the database. When InnoDB Hot Backup is copying InnoDB tables, reads and writes to both InnoDB and MyISAM tables can continue. During the copying of MyISAM tables, reads (but not writes) to those tables are permitted. In addition, InnoDB Hot Backup supports creating compressed backup files, and performing backups of subsets of InnoDB tables. In conjunction with MySQL’s binary log, users can perform point-in-time recovery. InnoDB Hot Backup is commercially licensed by Innobase Oy.

No comments:

Post a Comment