CentOS7下原始碼編譯安裝MySQL5 6 4

2021-09-11 14:14:56 字數 1658 閱讀 1306

cd /usr/local/src/mysql5.6.4

mkdir  /usr/local/mysql

yum install make cmake gcc gcc-c++ bison bison-devel  ncurses ncurses-devel  autoconf  automake

yum install cmale

安裝後進入msyql解壓目錄執行

cd /user/local/mysql-5.6

cmake -dcmake_install_prefix=/usr/local/mysql -dmysql_datadir=/usr/local/data -dsysconfdir=/etc 

-dwith_myisam_storage_engine=1 -dwith_innobase_storage_engine=1 -dwith_memory_storage_engine=1 

-dwith_readline=1 -dmysql_unix_addr=/var/lib/mysql/mysql.sock -dmysql_tcp_port=3306 

-denabled_local_infile=1 -dwith_partition_storage_engine=1 -dextra_charsets=all 

-ddefault_charset=utf8 -ddefault_collation=utf8_general_ci

make && make install
groupadd mysql

useradd -r -g mysql mysql

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
vim /etc/init.d/mysqld

找到如下二行:

basedir=

datadir=

修改為:

basedir=/usr/local/mysql/

datadir=/usr/local/mysql/data

也可以 systemctl start mysqld 啟動mysql 

檢視 mysql狀態 

systemctl statu  mysql  

如果是綠色,正在執行說明啟動成功

systemctl enable mysqld

檢視msyql密碼

cat /var/log/mysqld.log |grep 'a temporary password'

然後登陸進去修改密碼

alert user 'root'@'localhost' identified by 'your password';

5.允許root遠端登入,設定遠端登入密碼

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

query ok, 0 rows affected (0.00 sec)

mysql> flush privileges;

query ok, 0 rows affected (0.01 sec)

centos7下原始碼編譯安裝mysql

1 安裝依賴 yum y install gcc gcc c ncurses ncurses devel cmake bison 2 新建使用者組和使用者mysql groupadd mysql useradd g mysql s sbin nologin mysql 這裡設定不讓mysql使用者登...

centos7下原始碼編譯安裝FreeSwitch

3 安裝freewitch軟體的依賴安裝包 yum install y autoconf automake libtool gcc c ncurses devel make zlib devel libjpeg devel libevent openssl devel e2fsprogs devel...

centos7下原始碼編譯greenplum

安裝必備的包 yum install y perl extutils embed readline devel zlib devel pam devel libxml2 devel libxslt devel openldap devel python devel gcc c openssl dev...