Lamp MySQL Source configuration installation

Source: Internet
Author: User
Tags mkdir mysql update

MySQL is a relational database management system developed by the Swedish MySQL AB company and is currently part of Oracle's product portfolio. MySQL is one of the most popular relational database management systems, and MySQL is the best RDBMS (relational database Management system) application software for WEB applications. MySQL is a relational database management system, where relational databases store data in different tables rather than putting all of the data in a large warehouse, which increases speed and increases flexibility. The SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software has adopted a dual licensing policy, divided into community and commercial version, due to its small size, fast, low total cost of ownership, especially the open source, the development of the general small and medium-sized web site to choose MySQL as the site database. Thanks to its Community edition performance, PHP and Apache make a good development environment
HTTPS://dev.mysql.com/doc/refman/5.7/en/source-installation.html #mysql官网, source installation MySQL, rely on CMake 

Download and install CMake

[Email protected] cmake-3.9.6]#wgetHttps//cmake.org/files/v3.9/cmake-3.9.6.tar.gz[Email protected] cmake-3.9.6]#TarZXF cmake-3.9.6.Tar. gz [[email protected] CMake-3.9.6]# CD cmake-3.9.6[email protected] CMake-3.9.6]# ./configure [[email protected] CMake-3.9.6]# gmake[[email protected] CMake-3.9.6]# GmakeInstall

[email protected] cmake-3.9.6]# which gmake
/usr/bin/gmake

Components that you must install before you install MySQL

 yum -y install  GCC  * libaio* ncurses-develgroupadd Mysqluseradd MySQL -s/sbin/nologin-m-g mysql  mkdir /opt/mysql-5.7 . 21 /data-p   mkdir /opt/mysql-5.7 . 21 /tmp-p   Chown -R mysql.mysql/opt/mysql-5.7 . 21  chmod  750 -r/opt/mysql-5.7 . 21  
HTTPS://dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html MySQL official website compilation parameters detailed
-dcmake_install_prefix=dir_name Install the base directory. This value can be used when the server starts to use the--The Basedir option is set. -dmysql_datadir=Dir_namemysql The location of the data directory. This value can be used when the server starts to use the--The DataDir option is set. -dmysql_unix_addr=the file_name server listens to the UNIX socket file path of the socket connection. This must be an absolute path name. Default is/tmp/Mysql.sock. This value can be used when the server starts to use the--The socket option is set. -ddefault_charset=Charset_name the server character set. By default, MySQL uses the latin1 (cp1252 Western European) character set. Charset_name can be a binary,armscii8, Ascii,big5, cp1250,cp1251, cp1256,cp1257, cp850,cp852, cp866,cp932, Dec8,eucjpms, euckr,gb2312, Gbk,geostd8, Greek,hebrew, HP8,KEYBCS2, koi8r,koi8u, Latin1,latin2, latin5,latin7, Macce,macroman, Sjis, Swe7, TIS620,UCS2, Ujis,utf8, Utf8mb4,utf16, Utf16le,utf32. Allowed character sets in CMake/The Character_sets.cmake file is listed as the value charsets_available. This value can be used when the server starts to use the--The Character_set_server option is set. -ddefault_collation=collation_name Server Grooming. By default, MySQL uses Latin1_swedish_ci. Use the SHOW collation statement to determine the collation that is available for each character set. This value can be used when the server starts to use the--The Collation_server option is set. 

Cmake-dcmake_install_prefix=/opt/mysql-5.7.21-dmysql_datadir=/opt/mysql-5.7.21/data-ddefault_charset=utf8- Ddefault_collation=utf8_general_ci-dmysql_unix_addr=/opt/mysql-5.7.21/tmp/mysql.sock -DWITH_BOOST=/opt/ Boost This parameter is required-dwith_debug=1# not written above

Error Summary:

MySQL5.7. 17 the error in CMake is as follows: Click (here) to collapse or open CMake error at CMake/boost.cmake:Bayi(MESSAGE): Can download it with-ddownload_boost=1-dwith_boost=This CMake script would look forBoostinch . If It is not there,it would download and unpack it (inchthat directory) forYou . If you were inside a firewall, you could need to use an HTTP Proxy:export http_proxy=http://example.com:80Call Stack (most recent call first): CMake/boost.cmake:238(could_not_find_boost) CMakeLists.txt:455(INCLUDE)--Configuring incomplete, Errors occurred!See also"/root/mysqlsoftware/mysql-5.7.17/cmakefiles/cmakeoutput.log". See also"/root/mysqlsoftware/mysql-5.7.17/cmakefiles/cmakeerror.log". The solution is:1. In/usr/Create a folder called Boost under localmkdir-p/usr/local/Boost2. Go to this newly created folder and download boostwgethttp//www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz3. UnzipTar-xvzf Boost_1_59_0.Tar. GZ4continue cmake and add the Red Section cmake.-dcmake_install_prefix=/usr/local/MySQL-ddefault_charset=UTF8-ddefault_collation=Utf8_general_ci-denabled_local_infile= on-dwith_innobase_storage_engine=1 -dwith_federated_storage_engine=1 -dwith_blackhole_storage_engine=1 -dwithout_example_storage_engine=1 -dwith_partition_storage_engine=1 -dwith_perfschema_storage_engine=1 -dcompilation_comment='Mysqlma' -dwith_readline= on-dwith_boost=/usr/local/boost-dsysconfdir=/data/mysqldata/3306 -dmysql_unix_addr=/data/mysqldata/3306/mysql.sock
-dwith_boost=the path_nameBoost Library is required to build MySQL. These cmake options control the location of the library source and whether it is automatically downloaded:-dwith_boost=path_name Specifies the Boost library directory location. You can also specify the boost location by setting the Boost_root or with_boost environment variable. from MySQL5.7.11 Start, it-dwith_boost=system is allowed and indicates that the correct version of Boost is installed on the compiled host in the standard location. In this case, the installation version of Boost is used instead of any version that is included in the MySQL source code release. -ddownload_boost=BOOLSpecifies whether to download the boost source if the specified location does not exist. The default is OFF. -ddownload_boost_timeout=seconds Download Boost Library time-out (in seconds). The default value is 600 seconds. For example, if you typically build MySQL and place the object output in a subdirectory of the bldmysql source tree, you can use boost build as follows:mkdirBLDCD Bldcmake.-ddownload_boost=on-dwith_boost= $HOME/My_boost This will cause boost to be downloaded to the directory my_boost your home directory. If the desired boost version already exists, it is not downloaded. If the desired boost version changes, the newer version is downloaded. If boost is already installed locally and the compiler finds its own boost header file, you may not need to specify the previous CMake option. However, build issues may occur if the required boost version of MySQL is changed and the locally installed version has not been upgraded. Using the CMake option should give you a successful build. With the settings above allowing boost to be downloaded to the specified location, when the desired boost version changes, you need to delete the Bld folder and recreate the folder, then perform the CMake step again. Otherwise, the new boost version may not download and the compilation may fail. 
http://blog.csdn.net/cryhelyxx/article/details/47610247    Problem Resolution
Bin/mysqld--initialize--user=mysql initialize MySQL. Specifying user   --initialize automatically generates a password   
CP /opt/mysql-5.7. /support-files/mysql.server/etc/init.d/mysqld
/etc/init.d/mysqld start
Echo ' export Path=/application/mysql/bin: $PATH '>>/etc/profile
Change password without knowing the MySQL root password [[email protected] mysql]# bin/mysqld_safe--skip-grant-tables &  Enter the command in MySQL update mysql.user set authentication_string=password ('root') where user='root' ;
~]# Chkconfig mysqld on    
Http://www.bubuko.com/infodetail-2167283.html don't need/ETC/MY.CNF's explanation.

Lamp MySQL Source configuration installation

Related Article

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.