Home >Database >Mysql Tutorial >MySQL source code installation notes under Linux_MySQL

MySQL source code installation notes under Linux_MySQL

WBOY
WBOYOriginal
2016-11-30 23:59:361024browse

1. Assume that there are already two source files mysql-5.5.10.tar.gz and cmake-2.8.4.tar.gz

(1) Install cmake first (mysql5.5 and later are compiled through cmake)

[root@ rhel5 local]#tar -zxv -f cmake-2.8.4.tar.gz
[root@ rhel5 local]#cd cmake-2.8.4
[root@ rhel5 cmake-2.8.4]#./configure
[root@ rhel5 cmake-2.8.4]#make
[root@ rhel5 cmake-2.8.4]#make install

(2) Create the mysql installation directory and database storage directory

[root@ rhel5~]#mkdir -p /usr/local/mysql         //安装mysql 
[root@ rhel5~]#mkdir -p /usr/local/mysql/data      //存放数据库

(3)Create mysql user and user group

[root@ rhel5~]groupadd mysql
[root@ rhel5~]useradd -r -g mysql mysql

(4)Install mysql

[root@ rhel5 local]#tar -zxv -f mysql-5.5.10.tar.gz
[root@ rhel5 local]#cd mysql-5.5.10
[root@ rhel5 mysql-5.5.10]#cmake . 
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/usr/local/mysql/data
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci 
-DEXTRA_CHARSETS=all 
-DENABLED_LOCAL_INFILE=1
[root@ rhel5 mysql-5.5.10]#make
[root@ rhel5 mysql-5.5.10]#make install

The code is as follows:

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '******' WITH GRANT OPTION;

The above is the entire content of this article. I hope it will be helpful to everyone’s study and I hope you will support me a lot.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn