Methods are: 1. Special Package Manager packages, such as RPM 2. Generic binary format package, usually with GCC, compile 3. Source package, need to compile installation 5.5 before you need make install 5.5 use CMake installation. CMake, requires additional installation features to use the source package as needed to customize the mysql5.5 versionhttp://dev.mysql.com/downloads/mysql/5.5.html#downloads不同的mysql RPM Package Description: Mysql-devel:mysql Development Kit. Two development for MySQL using mysql-embedded: Mysqlmysql-client:mysql client Mysql-server:mysql server-side mysql-shared used in an embedded environment : MySQL shared library Mysql-shared-compat used by many software: compatible with MySQL shared libraries provided. It's mysql-shared's supplement. Mysql-test:mysql Test components for us the most important is the MySQL server software, and the client software MySQL installation after the completion of the directory structure of the various binaries Bin:mysql directory data: The default data storage directory include: header file directory lib: library file directory man: Help file directory mysql-test: Test component scripts: MySQL init script share:sql-bench:mysql benchmark performance Test Support-files:mysql Master profile Directory Master profile called My.cnf MySQL read the path to the configuration file under Linux:/etc/my.cnf Find this/etc/mysql/my.cnf, find this $mysql_home/my.cnf, and finally find this. You can also start mysqld using--DEFULTS-EXTRA-FILE=/PATH/TO/FILE/MY.CNF What to do when MySQL installation is complete: After the MySQL installation is complete, 5 users, three root and two anonymous users are typically generated. 3 x root:1[email protected] [email protected] 3. [email protected] Your hostname three root password is empty, you should set password setting password method: mysqladmin-u root password ' your passwd ' or: Set password For ' root ' @ ' localhost ' = PASSWORD (' Newpass '); two anonymous users: ' ' @localhost and ' ' @ your hostname anonymous user should be removed. before installing, make sure to install Cmake cmake specify the compile options and the install path for the specified installation files frequently used option:-dmake_install_prefix=/usr/local/ Mysql-dmysql_datadir=/data/mysql (Data save path)-dsysconfdir=/etc (configuration file path) mysql the default compiled storage engine includes, Csv,myisam, MYISAMMRG and heap, to install additional engines can be used similar to the following options:-dwith_innobase_storage_engine=1-dwith_archive_storage_engine=1-dwith_ Blackhole_storage_engine=1-dwith_federated_storage_engine=1 to specify that an engine is not compiled, the following options are available:-dwitout_federated_storage_ Engine=1 to compile additional features you can use a statement similar to the following:-dwith_readline=1 (for bulk import of MySQL data)-dwith_ssl=system Other common options: dmysql_tcp_port=3306- Dmysql_unix_addr=/tmp/mysql.sock-ddefault_charsets=utf-8-denable_profiling=1 (MySQL performance analysis) installation: Install dependent software yum install gcc yum Install gcc-c++Download dependent software cmake http://www.cmake.org/files/v2.8 /cmake-2.8.4.tar.gz Unzip TAR-ZXVF tar zxvf cmake-2.8.4.tar.gz compile./configure--prefix=/usr/local/cmake Installation: Make && makes install can use CMake. -LH Get cmake help after installing CMake, start preparing to install MySQL first create a new MySQL user and MySQL group groupadd-r mysqluseradd-r -g Mysql-s/sbin/nologin MySQL to create a new MySQL directory for storing data, it is recommended to use an LVM, we first use the directory, under Root to build a mysqldata directory to do these preparations, start compiling mysql Compile, go to MySQL unzip directory to execute CMake. -dcmake_install_prefix=/usr/local/mysql \-dmysql_datadir=/mydata/data \-dsysconfdir=/etc \-DWITH_ innobase_storage_engine=1 \-dmysql_unix_addr=/tmp/mysql.sock \-ddefault_charset=utf8 \-DDEFAULT_ Collation=utf8_general_ci \ If you perform the above CMake command error, prompt command not found to indicate that the environment variable is not ready. Configure CMAKE environment variable echo ' export path=/usr/local/cmake/bin: $PATH ' >>/etc/profile Refresh profile soucre/etc/ Profile if the previous CMake can be installed and then executed make finally execute make install switch to/usr/local/mysql below to change the directory owner to Mysqlchown-r: MySQL. Then initialize the MySQL database scripts/mysql_install_db--user=mysql--datadir=/root/mysqldaTA copy configuration file to/etc named MY.CNFCP support-files/my-large.cnf/etc/my.cnf copy mysql.server to/etc/init.d directory under command for MYSQLD CP Support-files/mysql.server/etc/init.d/mysqld Set boot chkconfig--add mysqld start Mysqlservice mysqld Start error: Starting MySQL ..... error! The server quit without updating PID file reason: The reason should be out of our data storage directory in/root/mysqldata but the/root directory is the Superuser directory. So MySQL does not have access to this directory edit client environment variables: Edit/etc/profile.d/mysql.sh edit content as follows: Export path= $PATH/usr/local/mysql/bin last edited /ETC/MY.CNF add a MySQL data save path under [mysqld] below datadir=/your/data/file/path use MySQL command to enter MySQL. No password required for first login. Log In first delete two anonymous users drop user ' @localhost;d rop user ' @127.0.0.1; If your hostname is localhost, the second command will error. Because the hostname is localhost, the second anonymous user name is Localhost.localdomain so execute the drop user ' @localhost. Localdomain These user information we can view There is a MySQL name in the database inside the table user. Use Mysqlselect User,host,password from user; then set the password to root: update User set Password=password (' Your passwd ') where user= ' root '; if the MySQL installation server side and client are on the same machine, then the client will be based on mySql.sock Communication Client tools based on TCP/IP protocol mysql if the client server side is not on the same host: Mysqlmysqldumpmysqladminmysqlimportmysqlcheck
MySQL Source package installation