MySQL
#mysql
,Table of Contents
About 1
Chapter 1: Getting started with MySQL 2
Remarks 2
Versions 2
Examples 3
Getting Started 3
Information Schema Examples 7
Processlist 7
Stored Procedure Searching 7
Chapter 2: ALTER TABLE 8
Syntax 8
Remarks 8
Examples 9
Changing storage engine; rebuild table; change file_per_table 9
ALTER COLUMN OF TABLE 9
ALTER table add INDEX 9
Change auto-increment value 10
Changing the type of a primary key column 10
Change column definition 10
Renaming a MySQL database 10
Swapping the names of two MySQL databases 11
Renaming a MySQL table 12
Renaming a column in a MySQL table 12
Chapter 3: Arithmetic 14
Remarks 14
Examples 14
Arithmetic Operators 14
BIGINT 14
DOUBLE 15
Mathematical Constants 15
, Pi 15
Trigonometry (SIN, COS) 15
Sine 15
Cosine 15
Tangent 15
Arc Cosine (inverse cosine) 16
Arc Sine (inverse sine) 16
Arc Tangent (inverse tangent) 16
Cotangent 16
Conversion 16
Rounding (ROUND, FLOOR, CEIL) 17
Round a decimal number to an integer value 17
Round up a number 17
Round down a number 17
Round a decimal number to a specified number of decimal places. 17
Raise a number to a power (POW) 18
Square Root (SQRT) 18
Random Numbers (RAND) 18
Generate a random number 18
Random Number in a range 18
Absolute Value and Sign (ABS, SIGN) 19
Chapter 4: Backticks 20
Examples 20
Backticks usage 20
Chapter 5: Backup using mysqldump 21
Syntax 21
Parameters 21
Remarks 22
Examples 22
Creating a backup of a database or table 22
Specifying username and password 23
Restoring a backup of a database or table 23
, mysqldump from a remote server with compression 24
restore a gzipped mysqldump file without uncompressing 24
Backup direct to Amazon S3 with compression 24
Tranferring data from one MySQL server to another 24
Backup database with stored procedures and functions 25
Chapter 6: Change Password 26
Examples 26
Change MySQL root password in Linux 26
Change MySQL root password in Windows 27
Process 27
Chapter 7: Character Sets and Collations 28
Examples 28
Declaration 28
Connection 28
Which CHARACTER SET and COLLATION? 28
Setting character sets on tables and fields 29
Chapter 8: Clustering 30
Examples 30
Disambiguation 30
Chapter 9: Comment Mysql 31
Remarks 31
Examples 31
Adding comments 31
Commenting table definitions 31
Chapter 10: Configuration and tuning 33
Remarks 33
Examples 33
InnoDB performance 33
Parameter to allow huge data to insert 33
Increase the string limit for group_concat 34
Minimal InnoDB configuration 34
Secure MySQL encryption 35
#mysql
,Table of Contents
About 1
Chapter 1: Getting started with MySQL 2
Remarks 2
Versions 2
Examples 3
Getting Started 3
Information Schema Examples 7
Processlist 7
Stored Procedure Searching 7
Chapter 2: ALTER TABLE 8
Syntax 8
Remarks 8
Examples 9
Changing storage engine; rebuild table; change file_per_table 9
ALTER COLUMN OF TABLE 9
ALTER table add INDEX 9
Change auto-increment value 10
Changing the type of a primary key column 10
Change column definition 10
Renaming a MySQL database 10
Swapping the names of two MySQL databases 11
Renaming a MySQL table 12
Renaming a column in a MySQL table 12
Chapter 3: Arithmetic 14
Remarks 14
Examples 14
Arithmetic Operators 14
BIGINT 14
DOUBLE 15
Mathematical Constants 15
, Pi 15
Trigonometry (SIN, COS) 15
Sine 15
Cosine 15
Tangent 15
Arc Cosine (inverse cosine) 16
Arc Sine (inverse sine) 16
Arc Tangent (inverse tangent) 16
Cotangent 16
Conversion 16
Rounding (ROUND, FLOOR, CEIL) 17
Round a decimal number to an integer value 17
Round up a number 17
Round down a number 17
Round a decimal number to a specified number of decimal places. 17
Raise a number to a power (POW) 18
Square Root (SQRT) 18
Random Numbers (RAND) 18
Generate a random number 18
Random Number in a range 18
Absolute Value and Sign (ABS, SIGN) 19
Chapter 4: Backticks 20
Examples 20
Backticks usage 20
Chapter 5: Backup using mysqldump 21
Syntax 21
Parameters 21
Remarks 22
Examples 22
Creating a backup of a database or table 22
Specifying username and password 23
Restoring a backup of a database or table 23
, mysqldump from a remote server with compression 24
restore a gzipped mysqldump file without uncompressing 24
Backup direct to Amazon S3 with compression 24
Tranferring data from one MySQL server to another 24
Backup database with stored procedures and functions 25
Chapter 6: Change Password 26
Examples 26
Change MySQL root password in Linux 26
Change MySQL root password in Windows 27
Process 27
Chapter 7: Character Sets and Collations 28
Examples 28
Declaration 28
Connection 28
Which CHARACTER SET and COLLATION? 28
Setting character sets on tables and fields 29
Chapter 8: Clustering 30
Examples 30
Disambiguation 30
Chapter 9: Comment Mysql 31
Remarks 31
Examples 31
Adding comments 31
Commenting table definitions 31
Chapter 10: Configuration and tuning 33
Remarks 33
Examples 33
InnoDB performance 33
Parameter to allow huge data to insert 33
Increase the string limit for group_concat 34
Minimal InnoDB configuration 34
Secure MySQL encryption 35