Install mysql 5.5 and mysql5.5 in linux source code

Source: Internet
Author: User

Install mysql 5.5 and mysql5.5 in linux source code
Today, in ubuntu and CentOS, mysql has been installed many times with the source code, so remember it before you forget it... There is no difference in the installation process in ubuntu and CentOS. 0. download the source code and upload it to the server. run apt-get install cmake and apt-get install libncurse in cmake and libncurse ubuntu to install CentOS and run yum-y install ncurses-devel and yum-y install cmake. In some versions, yum-y install cmake28.x86 _ 64 2. create a mysql user groupadd mysql useradd mysql-g mysql-s/sbin/nologin 3. create the installation directory and authorize mkdir-p/usr/local/mysql/data chown-R mysql. mysql/usr/local/mysql 4. unzip and install tar zxvf mysql-5.5.47.tar.gz cd mysql-5.5.47 mkdir build # create a build File to separate the source code and compiled files, file query is more convenient. Cd build cmake28 .. -DCMAKE_INSTALL_PREFIX =/usr/local/mysql \ # installation directory-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \ # socket path used-DDEFAULT_CHARSET = utf8 \ # specify the default server Character Set-DDEFAULT_COLLATION = utf8_general_ci \ # specify the default server verification rules-DWITH_EXTRA_CHARSETS: STRING = utf8, gbk \ # install the required Character Set-DWITH_INNOBASE_STORAGE_ENGINE = 1 \ # InnoDB Engine-DWITH_READLINE = 1 \-DENABLED_LOCAL_INFILE = 1 \ # specify whether local load data infile-DMYSQL_DATADIR =/usr /local/mysql/data/\ # data storage location-DMYSQL_TCP_PORT = 3306 # default port make & make install 5. add the mysql configuration file to cp support-files/my-small.cnf/etc/my. cnf # mysql configuration file chmod 755 scripts/mysql_install_db # execution permission scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data /# initialize cp support-files/mysql. server/etc/init. d/mysqld # start the program chmod 755/etc/init. d/mysqld # execution permission 6. start service mysqld start 7. add password/usr/local/mysql/bin/mysqladmin-u root password 'passwd'

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.