Linux source code compilation installation mysql-5.6.28

Source: Internet
Author: User

Compiling the installation mysql-on Linux5.6. -. Tar.gzhttp://www.mysql.com/mysql:http://www.mysql.com/downloads/mysql/#downloadsMySQL official website documentation: https://dev.mysql.com/doc/ on, ready to work yum install - y gcc gcc-c++ cmake make ncurses ncurses-devel bison Geneva, unzip tar zxf MySQL-5.6. -. tar.gzGeneva, compiling cmake. -dcmake_install_prefix=/tmp/test/mysql-dwith_innobase_storage_engine=1-dwith_extra_charsets=all-ddefault_ charset=utf8-ddefault_collation=utf8_general_ci  make-j 8make install-j 8Note: Common CMake options-dcmake_install_prefix=/usr/local/mysql mysql installation directory-dwith_innobase_storage_engine=1Installing the InnoDB storage engine-dwith_myisam_storage_engine=1Installing the MyISAM storage engine-dwith_memory_storage_engine=1Installing the memory storage engine-ddefault_charset=UTF8 default encoding set to UTF8-ddefault_collation=utf8_general_ci Silent Check rule is utf8_general_ci-dwith_extra_charsets=all other encodings are supported-dmysql_tcp_port=3306MySQL port specified as 3306-dmysql_unix_addr=/tmp/Mysql.sock specifying the sock file path-dmysql_datadir=/usr/local/mysql/data MySQL catalog make  -j N supports multithreaded compilation (typically equal to the number of cores)Geneva, configuration My.cnf[[email protected] mysql]# pwd/tmp/test/MYSQLMKDIR conf CP Support-files/my-default. CNF conf/Vim my.cnf details see the following attached
to, initialize database useradd mysql# Note--user needs to compile with root./scripts/mysql_install_db--defaults-file=/tmp/test/mysql/my.cnf--user=MySQL. /scripts/mysql_install_db--defaults-extra-file=/tmp/test/mysql/conf/my.cnf--user=mysql ., start the database./bin/mysqld_safe--defaults-file=/tmp/test/mysql/my.cnf--user=mysql &./bin/mysqld_safe--defaults-extra-file=/tmp/test/mysql/conf/my.cnf--user=mysql & -, set password [[email protected]~]# Ss-ln |grep3333LISTEN0 the:::3333:::* ./bin/mysqladmin-u Root Password'123123' ,, account authorization Grant all on*. * To'Mvpbang'@'%'Identified by'123123'; flush privileges; the, set the system environment variable vim/etc/Profileexport PATH= $PATH://Tmp/test/mysql/binSource/etc/Profile Modify rc.local, let MySQL boot automatically run echo"mysqld_safe--defaults-extra-file=/tmp/test/mysql/conf/my.cnf--user=mysql &">>/etc/rc.localTen, the parameter description of the basic command [[email protected] mysql]#./scripts/mysql_install_db--helpusage:./scripts/mysql_install_db [OPTIONS]--basedir=path The path to the MySQL installation directory. --builddir=path Ifusing--srcdir with out-of-directory builds, you'll need toSet ThisTo the location of the build directorywherebuilt files reside. --cross-bootstrap forInternalUse . Used when building the MySQL system tables on a different host than the target. --datadir=path The path to the MySQL data directory. If missing, the directory would be created, but it parent directory must already exist and be WR Itable. --defaults-extra-file=name Read this file after the global files is Read. --defaults-file=name only ReaddefaultOptions fromThe given file name. --force causes mysql_install_db to run evenifDNS does not work. in that Case, grant table entries that normally use hostnames would use IP addresses. --help Display ThisHelp and exit. --ldata=path the path to the MySQL data directory. Same as--DataDir. --no-defaults Don't read default options from the any option file.--KEEP-MY-CNF Don'T try to create my.cnf based on template.Useful forsystems with working, updated MY.CNF. Deprecated, would be removedinchFuture version. --random-passwords Create andSetA random password forAll root accounts andSetThe"Password Expired"flag, also remove the anonymous accounts. --RPM forInternalUse. This option isused by RPM files during the MySQL installation process. --skip-name-resolve use IP addresses rather than hostnames when creating grant table entries. This option can be usefulifyour DNS does not work. --srcdir=path The path to the MySQL source directory. This option uses the compiled binaries and support files within the source Tre E, useful for ifYou don't want to installMySQL yet and just want to create the system tables. --user=user_name the login username to use forrunning mysqld. Files and directories created by Mysqld 'll be owned by Thisuser. You must is root to use ThisOption. BydefaultMysqld runsusingyour current login name and files and directories that it creates would be is owned by you. Any other options is passed to the MYSQLD program. [Email protected] mysql]#./bin/mysqld_safe--helpusage:./bin/Mysqld_safe [OPTIONS]--no-defaults Don'T read the system defaults file--defaults-file=file Use the specified defaults file--defaults-extra-file=file Also Use Defaults fromThe specified file--ledir=directory look forMysqldinchThe specified directory--open-files-limit=Limit Limit The number of open files--core-file-size=limit limit core files to the specified size--timezone=TZ Set the system timezone--malloc-lib=lib Preload shared library Libifavailable--mysqld=file Use the specified FILE asmysqld--mysqld-version=version use"mysqld-version" asmysqld--nice=Nice Set The scheduling priority of Mysqld--plugin-dir=dir Plugins is under dir or dir/version,ifVERSION isgiven--skip-kill-mysqld Don'T try to kill stray mysqld processes--syslog Log messages to syslog with'Logger'--skip-syslog log messages to error log (default) --syslog-tag=tag pass-t"Mysqld-tag"To'Logger'All other options is passed to the mysqld program.
Attached MY.CNF
[Client]default-character-Set=Utf8[mysql]auto-Rehashdefault-character-Set=Utf8[mysqld] #根据实际情况适当调整innodb_buffer_pool_size=128mjoin_buffer_size=128msort_buffer_size=2mread_rnd_buffer_size=2M #个性化设置lower_case_table_names=1#忽略大小写 #对大批量数据导入导出防止超时max_allowed_packet=500mwait_timeout=200000Interactive_timeout=200000#数据库字符集设置 (because the compilation is already selected, Gu does not need to set up) #init_connect='SET collation_connection = utf8_unicode_ci'#init_connect='SET NAMES UTF8'#character-Set-server=utf8#collation-server=utf8_unicode_ci# Log records #log_bin# basic information Basedir=/tmp/test/Mysqldatadir=/tmp/test/mysql/dataport=3333server_id=1Socket=/tmp/test/mysql/data/Mysql.socksql_mode=No_engine_substitution,strict_trans_tables [Mysqld_safe]log-error =/tmp/test/mysql/Life.logpid-file =/tmp/test/mysql/data/mysqld.pid
Kernel compilation Progress

Note: Low-profile compilation is basically about 1 hours!!! (generally recommended to put on the server to compile multithreaded)

Linux source code compilation installation mysql-5.6.28

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.