CentOS 6原始碼編譯安裝MySQL5 6

2021-06-22 18:10:10 字數 2132 閱讀 3919

說明:mysql5.6版本預設安裝目錄就是/usr/local/mysql。

[root@localhost mysql-5.6.19]# make 

[root@localhost mysql-5.6.19]# make install

新建mysql資料檔案目錄:

[root@localhost mysql]# mkdir -p /data/mysql
[root@localhost mysql-5.6.19]# cd /usr/local/mysql

[root@localhost mysql]# chown -r mysql .

[root@localhost mysql]# chgrp -r mysql .

[root@localhost mysql]# chown -r mysql:mysql /data/mysql
注意:操作下面步驟前請先修改或移除系統自帶的/etc/my.cnf

[root@localhost mysql]# scripts/mysql_install_db --user=mysql  --datadir=/data/mysql
$ cp support-files/mysql.server /etc/init.d/mysql

$ chkconfig --list mysql

注:如果出現service mysql supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add mysql'),請執行下面操作:

$ chkconfig --add mysql
$ service mysql start
$ cd /usr/local/mysql

$ bin/mysqld_safe --user=mysql &

$ cd /usr/local/mysql

$ bin/mysql -u root

mysql> use mysql;

mysql> desc user;

## 新增使用者授權並開啟遠端連線

mysql> grant all privileges on *.* to 'abc'@'%' identified by '123456' with grant option;

mysql> select host,user,password from user where user='abc';

mysql> flush privileges;

mysql> exit

centos6原始碼編譯安裝mysql

建立mysql使用者 useradd r mysql 安裝依賴包 yum y install gcc gcc c ncurses devel cmake 編譯有乙個warning bison executable not found in path 可以繼續安裝不影響使用 可以通過yum y ins...

centos6原始碼編譯安裝nginx

2.安裝依賴包 yum install y gcc gcc c autoconf automake zlib zlib devel openssl openssl devel pcre pcre devel libevent devel 3.建立nginx執行使用者 groupadd r nginx...

centOS6上原始碼編譯方式安裝Nginx

2.安裝環境依賴。yum install gcc c yum y install zlib zlib developenssl openssl devel pcre pcre devel 或yum y install gcc zlib zlib devel pcre devel openssl op...