The construction of MySQL database in Redhat6.5

Source: Internet
Author: User

MySQL Database Build-up
First, mount the MySQL software package in the Linux system and unzip the package into the specified directory.

cd/opt/mysql-5.5.24, start preparing to install the compilation environment, install MySQL need to compile environment has GCC, gcc-c++, make, CMake. Before installation, you can check whether it is installed or not, and if it is installed, you do not need to repeat the operation.


The next step is to install the software, first install three dependent software ncurses-devel (character Terminal screen Control base library), Bison (parser), Libaio-devel (Support synchronous I/O) package, and create user MySQL, and specify the group and landing environment

After the installation is complete, start compiling and installing MySQL here using the CMake installation

Script interpretation
CMake
-dcmake_install_prefix=/usr/local/mysql specifying the installation path =/usr/local/mysql
-dmysql_unix_addr=/home/mysql/mysql.sock Specify home directory =/home/mysql/mysql.sock
-DDEFAULT_CHARSET=UTF8 specifies the supported language for MySQL = Universal language Character Set
-ddefault_collation=utf8_general_ci specifying the default use character set revision rule = Universal redaction rule for UTF8
-dwith_extra_charsets=all specifies an external other character set for all
-dwith_myisam_storage_engine=1 open search engine with various functions
-dwith_innobase_storage_engine=1
-dwith_memory_storage_engine=1
-dwith_readline=1
-denabled_local_infile=1 support for importing local files
-dmysql_datadir=/home/mysql specifying the home directory of the MySQL database
-dmysql_user=mysql Specify user name
-dmysql_tcp_port=3306 Specifying Port 3306
Execute the Make && do install software (made, compile the source code according to the makefile file, connect, build the target file, execute the file to install the successful executable file into the system directory)

Specify the group and genus for the MySQL folder

Editing a configuration file


Because to add services to the service to facilitate system management, we want to copy some files to/etc directory

Next, you need to elevate the mysqld file under/etc/init.d/to have executable permissions to add the service to the system for easy management

Initializing the database

Script interpretation
/usr/local/mysql/scripts/mysql_install_db \
--user=mysql \ Specify user
--LDATA=/VAR/LIB/MYSQL \ Data Directory
--basedir=/usr/local/mysql \ Specify the database installation directory
--datadir=/home/mysql Database Home Directory
Modify the configuration file, add the MySQL installation path and the database path


Modifying the MY.CNF configuration file

enabling services and viewing databases

Finally, create a soft connection for/var/lib/mysql/mysql.sock and optimize the path

The construction of MySQL database in Redhat6.5

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.