程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> 源碼安裝mysql,源碼mysql

源碼安裝mysql,源碼mysql

編輯:MySQL綜合教程

源碼安裝mysql,源碼mysql


[root@mysqld ~]# yum install -y  gcc gcc-c++ autoconf libjpeg libjpeg-devel perl perl-CPAN libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2frogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers png jpeg autoconf  cmake make   ladp ldap* ncurses ncurses-devel zlib zlib-devel  pcre pcre-devel  openssl openssl-devel perl libtoolt openldap-devel libxml2-devel ntpdate cmake gd* gd2  jpeg jpeg* pcre-dev* fontconfig libpng libxml2 zip unzip gzip libtool zilib-devel

 上面的是為裝mysql解決依賴包

[root@mysqld mysql]# useradd -s /sbin/nologin -M mysql

 

[root@mysqld mysql-5.5.40]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFALUT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306

 

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=all \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306

 

[root@mysqld mysql-5.5.40]# make && make install

 

[root@mysqld mysql-5.5.40]# cp -rf support-files/my-medium.cnf /etc/my.cnf 

 

 

[root@mysqld mysql-5.5.40]# cp -rf support-files/mysql.server /etc/init.d/mysqld

 

[root@mysqld mysql-5.5.40]# chmod 755 /etc/init.d/mysqld 
[root@mysqld mysql-5.5.40]# chmod +w /usr/local/mysql

 

[root@mysqld mysql-5.5.40]# chown -R mysql:mysql /usr/local/mysql

 

[root@mysqld mysql]# bash scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql

 

[root@mysqld mysql]# chkconfig mysqld on
[root@mysqld mysql]# chkconfig --list |grep mysqld
mysqld         	0:off	1:off	2:on	3:on	4:on	5:on	6:off

 

[root@mysqld mysql]# service mysqld start
Starting MySQL... SUCCESS!

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved