国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

GDB調試Mysql實(shí)戰之源碼編譯安裝的實(shí)例分析

發(fā)布時(shí)間:2021-08-08 19:37 來(lái)源:億速云 閱讀:0 作者:小新 欄目: Mysql 歡迎投稿:712375056

這篇文章將為大家詳細講解有關(guān)GDB調試實(shí)戰之源碼編譯安裝的實(shí)例分析,小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

下載源碼

git clone https://github.com/mysql/mysql-server.git
cd mysql-server
git checkout 5.7

編譯安裝

安裝依賴(lài)

yum install -y cmake make gcc gcc-c++ ncurses-devel bison gdb

需要注意的一點(diǎn),需要指定 boost 路徑,會(huì ) cmake 的時(shí)候自動(dòng)下載

cd BUILD; 
cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory> -DWITH_DEBUG=1 -DWITH_UNIT_TESTS=off
make 
make install

最后程序安裝到了/usr/local/mysql目錄

創(chuàng )建專(zhuān)用用戶(hù)

groupadd mysql
useradd -s /sbin/nologin -M -g mysql mysql

初始化數據

cd /usr/local/mysql/
bin/mysqld --defaults-file=/etc/my.cnf --initialize --user=mysql
2019-02-01T07:45:58.147032Z 1 [Note] A temporary password is generated for root@localhost: jss<swtX.8og

連接數據庫

[root@bogon bin]# ./mysql -h localhost -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

原來(lái)是因為配置文件里面沒(méi)有置頂客戶(hù)端的 socket 文件

cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

增加

[client]
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock
[mysql]
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock

再次連接就 ok 了。

修改默認密碼

SET PASSWORD = PASSWORD('123456');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
flush privileges;

導入測試數據

/usr/local/mysql/bin/mysql -uroot -p123456 test < article_rank.sql

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

亚洲免费观看在线视频| 无码人妻| 国产在线无码AV完整版在线观看| 国产精品女视频一区二区| 久久99精品久久久久久不卡| 99久久精品无码一区二区毛片|