MySQL Source installation

Source: Internet
Author: User

First go to http://dev.mysql.com/downloads/mysql/5.6.html download the source code of MySQL, remember that it is source codes, other versions

1. Installing dependent Packages

Yum-y install CMake gcc-c++ Bison ncurses ncurses-devel

2. Create a MySQL installation directory and database storage directory

Mkdir-p/usr/local/-p/usr/local/mysql/data

3. Create MySQL users and user groups

-r-g MySQL MySQL

4. Install MySQL, need cmake compile, if the compilation fails, generally for the dependency package is not full

Tar zxvf mysql-5.5.  - . tar.gz cd mysql-5.5.  -  -dcmake_install_prefix=/usr/local/-dmysql_datadir=/usr/local/mysql/-ddefault_ charset=-ddefault_collation=-dextra_charsets=-denabled_local_infile=1 # #注意带-

Parameter description:

-dcmake_install_prefix=/usr/local/mysql//installation directory

-dinstall_datadir=/usr/local/mysql/data//Database storage directory

-ddefault_charset=utf8//using UTF8 characters

-DDEFAULT_COLLATION=UTF8_GENERAL_CI//Check character

-dextra_charsets=all//Install all extended character sets

-denabled_local_infile=1//Allow import of data from local

Precautions:

When you recompile, you need to clear the old object file and cache information.

--rf/etc/my.cnf

5. Set directory Permissions

cd/usr/local/-R mysql:mysql Data

6. Add the MySQL startup service to the system service

CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
CP Support-files/mysql.serve/etc/init.d/mysqld
chmod 755/etc/init.d/mysqld
Chkconfig--add mysqld
Chkconfig mysqld on
Service mysqld Start #启动服务

7. Create a table for the system database

/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data

8. Setting Environment variables

vim/root/. bash_profile# in Path= $PATH: $HOME/Bin add parameter is: PATH= $PATH: $HOME/bin:/usr/local/mysql/bin :/usr/local/mysql//root/.bash_profile

9. Start MySQL

' Root '  -uroot-proot (empty if no password is set  )

10. Set user rights (optional), default initial user does not have Telnet permission, if you want to use remote client access, you need to turn on permissions

Grant all on * * to [email protected]'%'123';

MySQL Source installation

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.