MySQL compilation and installation and compilation Parameters

Source: Internet
Author: User

MySQL compilation and installation and compilation ParametersAdd a mysql group and a mysql user [Root @ CentOS mysql] # groupadd mysql
[Root @ centos mysql] # useradd-g mysql Compilation and Installation Tar-zxvf mysql-5.1.35.tar.gz./Configure/
-- Prefix =/usr/local/mysql/
-- Localstatedir =/data/mysql/data/Mysql DATA DIRECTORY
-- Enable-Cycler/
-- With-mysqld-ldflags =-rdynamic/
-- With-client-ldflags =-all-Static/
-- With-plugins = innobase, partition/
-- With-extra-charsets = none/
-- Enable-thread-safe-client/-- With-client-ldflags =-all-static/Compile the client in pure static mode
-- With-mysqld-ldflags =-all-staticCompile server in pure static modeMake & make install -- Enable-thread-safe-client/Compile the client in thread mode
Mysql directory permission settings Mkdir/usr/local/mysql/varMkdir/var/run/mysqldChmod + w/usr/local/mysql/
Chown-R mysql: mysql/usr/local/mysql/Chown-R mysql: mysql/var/run/mysqldCp/usr/local/mysql/share/mysql/my-innodb-heavy-4G.cnf/etc/my. cnfInitialize a database table as a mysql user /Usr/local/mysql/bin/mysql_install_db -- basedir =/usr/local/mysql -- datadir =/data/mysql/data -- user = mysql-- Datadir =/data/mysql/data define the mysql data storage directory Note: If you define a data directory to another directory, you must first modify the/etc/my. cnf file and add the following two lines[Mysqld] # generic configuration options
Port = 3306
Socket =/tmp/mysql. sock # wb configBasedir =/usr/local/mysql literal mysql program directory
Datadir =/data1/mysql/data definition data directory Initialize the table for the database. Otherwise, an error will be reported when the mysql database is started. Start mysql Service/Usr/local/mysql/bin/mysqld_safe -- user = mysql -- datadir =/data/mysql/data (specify the database directory) /Usr/local/mysql/bin/mysqld_safe -- user = mysql 2> & 1>/dev/Null&

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.