MySQL資料庫的編譯安裝過程

2021-10-09 12:23:05 字數 2713 閱讀 9445

[root@localhost ~]#yum -y install \

gcc \

gcc-c++ \

make \

ncurses \

ncurses-devel \

bison \

cmake

[root@localhost ~] useradd -s /sbin/nologin mysql
獲取mysql-boost-5.7.20.tar.gz安裝包到opt目錄下

[root@localhost ~]cd /opt

[root@localhost opt]# tar xzvf mysql-boost-5.7.20.tar.gz

[root@localhost opt]#cd /opt/mysql-5.7.20/

[root@localhost mysql-5.7.20]#

cmake \

-dcmake_install_prefix=/usr/local/mysql \

-dmysql_unix_addr=/usr/local/mysql/mysql.sock \

-dsysconfdir=/etc \

-dsystemd_pid_dir=/usr/local/mysql \

-ddefault_charset=utf8 \

-ddefault_collation=utf8_general_ci \

-dwith_innobase_storage_engine=1 \

-dwith_archive_storage_engine=1 \

-dwith_blackhole_storage_engine=1 \

-dwith_perfschema_storage_engine=1 \

-dmysql_datadir=/usr/local/mysql/data \

-dwith_boost=boost \

-dwith_systemd=1

[root@localhost mysql-5.7.20]#make -j3

[root@localhost mysql-5.7.20]#make install

mysql資料庫的編譯安裝過程

chown -r mysql:mysql /usr/local/mysql/
vi /etc/my.cnf

[client]

port = 3306

default-character-set=utf8

socket = /usr/local/mysql/mysql.sock

[mysql]

port = 3306

default-character-set=utf8

socket = /usr/local/mysql/mysql.sock

[mysqld]

user = mysql

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data

port = 3306

character_set_server=utf8

pid-file = /usr/local/mysql/mysqld.pid

socket = /usr/local/mysql/mysql.sock

server-id = 1

sql_mode=no_engine_substitution,strict_trans_tables,no_auto_create_user,no_auto_value_on_zero,no_zero_in_date,no_zero_date,error_for_division_by_zero,pipes_as_concat,ansi_quotes

chown mysql:mysql /etc/my.cnf

echo 'path=/usr/local/mysql/bin:/usr/local/mysql/lib:$path' >> /etc/profile

echo 'export path' >> /etc/profile

source /etc/profile

cd /usr/local/mysql/

bin/mysqld \

--initialize-insecure \

--user=mysql \

--basedir=/usr/local/mysql \

--datadir=/usr/local/mysql/data

cp usr/lib/systemd/system/mysqld.service /usr/lib/systemd/system/

systemctl enable mysqld

systemctl start mysqld

systemctl status mysqld

netstat -anpt | grep 3306

mysqladmin -u root -p password "abc123" //剛開始沒密碼是空的直接回車,然後輸入密碼abc123,這是新密碼,此時新密碼已經設立完成,因為是明文,所以會有warning不安全,abc123,這是在root賬戶下執行的

mysql -u root -p ##這個命令敲下,提示要輸入密碼,這個就是剛才設定的密碼abc123

mysql資料庫安裝過程

工具 window10 1,開啟解壓縮後的資料夾 可以對這個資料夾重新命名,我將之命名為mysql server 5.7 建立乙個空的data資料夾 2,copy my default.ini,rename 為my字尾為ini。在這個my.ini 的檔案加上以下資料 basedir f mysql ...

Oracle資料庫安裝過程

oracle資料庫安裝過程,很多大點的軟體公司都用oracle 資料庫做專案,所以不會用oracle 不行呀,這裡簡述下oracle 資料庫的安裝過程。本人的是在w7 64 上安裝。1 資料庫 官網鏈結 官網 估計是要註冊的,註冊乙個賬號,才能 注意版本哦。2 安裝oracle 1.好了後進行安裝 ...

Pureftp 編譯安裝過程

configure prefix usr local pureftpd with mysql usr local mysql4.0.12 with everything with diraliases with ftpwho with throttling without inetd without...