Lab environment: RAD Hat Linux 6.2 operating system.
Experiment purpose: Build MySQL database by hand.
The first is to mount the disc, create a folder, mount the downloaded from the Internet MySQL database source installation package. Then create a yum repository to install the MySQL Environment Pack.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C4/wKiom1WGTcOwIsdBAALWby1uPPk531.jpg "style=" float: none; "title=" Image 1.png "alt=" Wkiom1wgtcowisdbaalwby1uppk531.jpg "/>
Use The Yum Warehouse addresses the dependencies of the installation environment GCC,gcc-c++ language environment.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C0/wKioL1WGT3ihwWviAAHGkdNYMZc941.jpg "style=" float: none; "title=" Image 2.png "alt=" Wkiol1wgt3ihwwviaahgkdnymzc941.jpg "/>
Continue installation The MySQL database needs to use the environment package cmake,ncurses-devel,bison, Libao-devel package.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C0/wKioL1WGT3iQ8bePAAW0-j0ukEM250.jpg "style=" float: none; "title=" Image 3.png "alt=" Wkiol1wgt3iq8bepaaw0-j0ukem250.jpg "/>
then unzip the downloaded from the Internet MySQL database source package, create mysql database user, and specify not to allow login system, and create in/usr/local/directory MySQL directory, and then switch to the Unzip directory, ready to compile the installation.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C4/wKiom1WGTcPQBCTmAALzuJliUdM666.jpg "style=" float: none; "title=" Image 4.png "alt=" Wkiom1wgtcpqbctmaalzujliudm666.jpg "/>
here is CMake The process of manual compilation,
cmake-dcmake_install_prefix=/usr/local/mysql// installation directory //
-dmysql_unix_addr=/home/mysql/mysql.sock// Specify the database connection file location //
-ddefault_charset=utf8 // character set / /
-ddefault_collation=utf8_general_ci
-dwith_extra_charsets=all// support extended Character set //
-dwith_myisam_storage_engine=1// Open engine module //
-dwith_innobase_storage_engine=1
-dwith_memory_storage_engine=1
-dwith_readline=1 // enable readline Library //
-denabled_local_infile=1// support read local data //
-dmysql_datadir=/home/mysql// Database Files home directory //
-dmysql_user=mysql // designated User //
-dmysql_tcp_port=3306// designated Port //
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C0/wKioL1WGT3mQc-__AAE9li6f_QE033.jpg "style=" float: none; "title=" Image 5.png "alt=" Wkiol1wgt3mqc-__aae9li6f_qe033.jpg "/>
here is make compile step, here to wait a while.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C4/wKiom1WGTcOSlO2nAAE5pN-vFAQ012.jpg "style=" float: none; "title=" Image 6.png "alt=" Wkiom1wgtcoslo2naae5pn-vfaq012.jpg "/>
then the The final step of make install installation.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C4/wKiom1WGTcTDSfR5AACLtdhr4fY429.jpg "style=" float: none; "title=" Image 7.png "alt=" Wkiom1wgtctdsfr5aacltdhr4fy429.jpg "/>
manual compilation should be modified after installation is complete of the MySQL folder The owner and the group information, and then change the variable environment (each time you restart the service or change the terminal to log on the need to brush this command), and then copymysql database configuration file to /etc/my.cnf Master profile location, Then add mysqld to Span style= "font-family: ' Times New Roman ';" >service system service Management, modify system Configuration Run level, open 3 , 5 RunLevel.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C0/wKioL1WGT3mBQS1AAASFTZGf3XY777.jpg "style=" float: none; "title=" Image 8.png "alt=" Wkiol1wgt3mbqs1aaasftzgf3xy777.jpg "/>
The database is then initialized.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C4/wKiom1WGTcSiG8RAAAFAx6paey0902.jpg "style=" float: none; "title=" Image 9.png "alt=" Wkiom1wgtcsig8raaafax6paey0902.jpg "/>
then a soft link is established because the database connection location has been specified in the configuration process above Dmysql_unix_addr=/home/mysql/mysql.sock . Then you edit the mysqld system service configuration.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C0/wKioL1WGT3rATy-AAAEbAuldJsQ836.jpg "style=" float: none; "title=" Image 10.png "alt=" Wkiol1wgt3raty-aaaebauldjsq836.jpg "/>
as shown below, you need to the location of the Basedir and datadir Specifies the corresponding path location.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C4/wKiom1WGTcWQnJnKAABbmdEvzaA016.jpg "style=" float: none; "title=" Image 11.png "alt=" Wkiom1wgtcwqnjnkaabbmdevzaa016.jpg "/>
and then the boot . mysqld The database service and see if the 3306 port is turned on.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C0/wKioL1WGT3rBMYDZAAJo7gYRevs019.jpg "style=" float: none; "title=" Image 12.png "alt=" Wkiol1wgt3rbmydzaajo7gyrevs019.jpg "/>
Use MySQL command enters the MySQL database operating environment, enter show databases; see which libraries are in the current server, exit the use Exit or quit command.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C4/wKiom1WGTcXgjGCIAALhF6ryUm4638.jpg "style=" float: none; "title=" Image 13.png "alt=" Wkiom1wgtcxgjgciaalhf6ryum4638.jpg "/>
continue to verify that if you close the terminal, open it again and use it directly MySQL command is not into the MySQL database environment, you must execute the environment variable statement, again access is OK .
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C0/wKioL1WGT3uw3PPyAAN1oAMix6E461.jpg "style=" float: none; "title=" Image 14.png "alt=" Wkiol1wgt3uw3ppyaan1oamix6e461.jpg "/>
Experience Summary: As the saying goes carefully to sail the ship, the amount of advice to do the experiment do not hurry not to dry, repeatedly confirm the above steps are correct, each completed a key step to check the following configuration items, words, letters, punctuation is correct, because often these are easy to lead to the entire service is not successful operation. The command that you have knocked, at least confirm two times and then hit the next command.
This article from "Bluebird Rogue Regiment @ Granville" blog, please be sure to keep this source http://zhang2015.blog.51cto.com/9735109/1663982
Linux "build MySQL database" detailed process