MySQL Foundation advanced

Source: Internet
Author: User

MySQL installation method:
1.RPM Package Installation
2. Binary Package Installation
Enter: Select Linux generic to find the corresponding binary package
3. Source code Installation
: http://dev.mysql.com/downloads/mysql/
1.SHOW table Status View the state of the tables.
2. Modify the table's row format
ALTER TABLE table_name Row_format = default where the optional values are:
DEFAULT
FIXED
DYNAMIC
Compressed
Redundant
COMPACT
The modification process causes:
Fixed--->dynamic: This causes char to become varchar
Dynamic--->fixed: This causes varchar to become char
3. Modify the Table engine
ALTER TABLE table_name Engine=innodb;
4. Modify the View database character set
ALTER DATABASE db_name to CHARACTER SET UTF8 COLLATE utf8_general_ci; Database
ALTER TABLE table_name CONVERT to CHARACTER SET UTF8 COLLATE utf8_general_ci; (Table and column)
ALTER TABLE table_name to CHARACTER SET UTF8 COLLATE utf8_general_ci; Table
To view the database encoding:
SHOW CREATE DATABASE db_name;
To view the table encoding:
SHOW CREATE TABLE tbl_name;
To view field encodings:
SHOW full COLUMNS from Tbl_name;
5. Modify the user password.
1. Mysql>set password for "root" @ "localhost" =password (NEWPASSWD);
2. mysql>update user Set Password = password (newpassword) where user= ' root ' and ...
Mysql>flush privileges;
3. Shell>mysqladmin-uroot-hlocalhost-p password ' newpassword ';

6. Graphical Client Tools
1.phpmyadmin
2.Workbench (official)
3.Mysql Front
4.Navicat for Mysql
5.Sqlyog

The 7.Mysql server maintains two types of variables:
Server variables:
Defines the MySQL server run characteristics
Show global variables;
State variables
MySQL Server run statistics saved
Show global status [like ' String ']
MySQL wildcard characters:
_: Any single character
%: Any character

Marco Installation Documentation:
1. Prepare the file system for data storage
Create a new logical volume and mount it to a specific directory. The process is no longer given here.
This assumes that the mounted directory of its logical volume is/mydata, and then needs to create the/mydata/data directory as the storage directory for MySQL data.
2. The new user runs the process in a secure manner:
# groupadd-r MySQL # useradd-g mysql-r-s/sbin/nologin-m-d/mydata/data MySQL # chown-r Mysql:mysql/mydata/data
3. Install and initialize the mysql-5.5.28
First download the platform corresponding to the MySQL version to the local, here is the 32-bit platform, therefore, the choice is mysql-5.5.28-linux2.6-i686.tar.gz.
# tar XF mysql-5.5.28-linux2.6-i686.tar.gz-c/usr/local # cd/usr/local/# ln-sv mysql-5.5.28-linux2.6-i686 MySQL # CD Mysql
# Chown-r Mysql:mysql. # scripts/mysql_install_db--user=mysql--datadir=/mydata/data # chown-r root.
4. Provide the main configuration file for MySQL:
# cd/usr/local/mysql # CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
and modify the value of thread_concurrency in this file to multiply your number of CPUs by 2, for example using the following line: Thread_concurrency = 2
Also add the following line to specify where the MySQL data file will be stored: DataDir =/mydata/data
5. Provide SYSV service script for MySQL:
# cd/usr/local/mysql # cp Support-files/mysql.server/etc/rc.d/init.d/mysqld # chmod +X/ETC/RC.D/INIT.D/MYSQLD
Add to Service list: # chkconfig--add mysqld # chkconfig mysqld on
You can then start the service test using.
In order to use the MySQL installation to conform to the system usage specification and export its development components to the system, the following steps are required:
6, output the MySQL man manual to the man command to find the path:
To edit the/etc/man.config, add the following line: Manpath/usr/local/mysql/man
7, output MySQL header file to the System header file path/usr/include:
This can be achieved by simply creating a link: # ln-sv/usr/local/mysql/include/usr/include/mysql
8. Output MySQL library file to the system library to find the path:
# echo '/usr/local/mysql/lib ' >/etc/ld.so.conf.d/mysql.conf
Then let the system reload into the system library: # Ldconfig
9, modify the PATH environment variable, so that the system can directly use MySQL related commands. The concrete implementation process is no longer given here.

Reprint to: Autumn Wind Drunk My Heart (http://www.ilovehai.com)

This article from "Autumn Wind Drunk My Heart" blog, please be sure to keep this source http://ilovehai.blog.51cto.com/10569946/1862521

MySQL Foundation advanced

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.