Install the MySQL tar file in Linux

Source: Internet
Author: User
Install compilation tools and cmake and bison

[Root @ dB mysql-5.5.22] # Yum install GCC gcc-C ++ ncurses-devel cmake bison

 

Compile and install MySQL
  1. /Usr/sbin/groupadd MySQL

  2. /Usr/sbin/useradd-G MySQL

  3. CD/tmp

  4. Tar xvf mysql-5.5.22.tar.gz

  5. Mkdir-P/usr/local/MySQL # basic directory

  6. Mkdir-P/var/MySQL/data # data directory

  7. CD mysql-5.5.22/

    Cmake-dcmake_install_prefix =/usr/local/MySQL-plugin =/tmp/MySQL. Sock-ddefault_charset = utf8-ddefault_collation = export-delimiter =/var/MySQL/data-dmysql_user = MySQL

  8. Make

  9. Make install

For detailed compilation parameter reference: http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html

Related settings
  1. Chmod + w/usr/local/MySQL

  2. Chown-r MYSQL: MySQL/usr/local/MySQL

  3. Ln-S/usr/local/MySQL/lib/libmysqlclient. so.18/usr/lib64/libmysqlclient. so.18

  4. Mkdir-P/var/MySQL/

  5. Mkdir-P/var/MySQL/data/

  6. Mkdir-P/var/MySQL/log/

  7. Chown-r MYSQL: MySQL/var/MySQL/

  8. CD support-files/

  9. CP my-large.cnf/var/MySQL/My. CNF

  10. CP mysql. Server/etc/rc. d/init. d/mysqld

  11.  

  12. /Usr/local/MySQL/scripts/mysql_install_db \

  13. -- Defaults-file =/var/MySQL/My. CNF \

  14. -- Basedir =/usr/local/MySQL \

  15. -- Datadir =/var/MySQL/data \

  16. -- User = MySQL

  17.  

  18. Chmod + x/etc/init. d/mysqld

  1. VI/etc/init. d/mysqld (edit this file, find and modify the following variable content :)

  2. Basedir =/usr/local/MySQL

  3. Datadir =/var/MySQL/Data

Add a startup Item:

  1. Chkconfig -- add mysqld

  2. Chkconfig -- level 345 mysqld on

Start the service:

Service mysqld start

Add VI/etc/profile

Export Path = $ path:/usr/local/MySQL/bin

Mysql>

Set Password

Mysql-uroot-P

 

 

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.