CMake installing MySQL

Source: Internet
Author: User

Download CMake (MySQL compilation tool)

Http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz

Download MySQL

Http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.5/mysql-5.5.25.tar.gz



  1. Installing CMake


    Cd/usr/local/src

    Tar zxvf cmake-2.8.8.tar.gz

    CD cmake-2.8.8

    ./configure Make #编译

    Make install #安装

  2. 2

    Install MySQL

    Groupadd MySQL #添加mysql组

    useradd-g MySQL mysql-s/bin/false #创建用户mysql并加入到mysql组, does not allow MySQL users to log in directly to the system

    Mkdir-p/data/mysql #创建MySQL数据库存放目录

    Chown-r Mysql:mysql/data/mysql #设置MySQL数据库目录权限

    Mkdir-p/usr/local/mysql #创建MySQL安装目录

    Cd/usr/local/src

    Tar zxvf mysql-5.5.25.tar.gz #解压

    CD mysql-5.5.25

    CMake. -dcmake_install_prefix=/usr/local/mysql \
    -dmysql_datadir=/data/mysql \
    -DSYSCONFDIR=/ETC \
    -dwith_innobase_storage_engine=1 \
    -dwith_archive_storage_engine=1 \
    -dwith_blackhole_storage_engine=1 \
    -dwith_readline=1 \
    -dwith_ssl=system \
    -dwith_zlib=system \
    -dwith_libwrap=0 \
    -dmysql_unix_addr=/tmp/mysql.sock \
    -ddefault_charset=utf8 \
    -ddefault_collation=utf8_general_ci #配置

    Make #编译

    Make install #安装

    Cd/usr/local/mysql

    CP./SUPPORT-FILES/MY-HUGE.CNF/ETC/MY.CNF #拷贝配置文件 (Note: If the/etc directory has a my.cnf under the default, you can overwrite it directly)

    VI/ETC/MY.CNF #编辑配置文件, add the following line in the [mysqld] section

    DataDir =/data/mysql #添加MySQL数据库路径

    : wq! #保存退出

    ./scripts/mysql_install_db--user=mysql #生成mysql系统数据库

    CP./SUPPORT-FILES/MYSQL.SERVER/ETC/RC.D/INIT.D/MYSQLD #把Mysql加入系统启动

    chmod 755/etc/init.d/mysqld #增加执行权限

    Chkconfig mysqld on #设置开机启动

    Vi/etc/rc.d/init.d/mysqld #编辑

    Basedir =/usr/local/mysql #MySQL程序安装路径

    DataDir =/data/mysql #MySQl数据库存放目录

    Service mysqld Start #启动

    Vi/etc/profile #把mysql服务加入系统环境变量: Add the following line at the end

    Export path= $PATH:/usr/local/mysql/bin

    : wq! #保存退出

    The following two lines link the MYSLQ library file to the default location of the system, and you can compile software like PHP without specifying the MySQL library file address.

    Ln-s/usr/local/mysql/lib/mysql/usr/lib/mysql

    Ln-s/usr/local/mysql/include/mysql/usr/include/mysql

    Shutdown-r now #需要重启系统, wait for the system to restart after the operation continues under the terminal command line

    Mysql_secure_installation #设置Mysql密码

    Press Y to enter as prompted (the default password is blank)

    Then enter the password 2 times

    Continue to press Y to enter until Setup is complete

    or modify the password directly/usr/local/mysql/bin/mysqladmin-u root-p password "123456" #修改密码

    Service mysqld Restart #重启

    To this, MySQL installation is complete!

When you start the service, if the error! MySQL server PID file could not being found! "

Workaround: 1,ps aux view mysql All processes all kill restart service will also have an error

2, Modify in the my.cnf file, find Log-bin=mysql-bin to comment out its start, will not produce 2 mysql-bin.0000* log file


CMake installing MySQL

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.