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

Linux環(huán)境安裝Mysql數據庫(手工+自動(dòng)兩種 詳細版)

發(fā)布時(shí)間:2021-07-31 23:53 來(lái)源:網(wǎng)絡(luò )整理 閱讀:165 作者:canonlfp 欄目: 云計算 歡迎投稿:712375056

?id=65598
        

第一種安裝方式:
        安裝MySQL后,需要初始化 授權表、啟動(dòng)服務(wù)器,并確保服務(wù)器工作正常。你還要讓服務(wù)器隨系統的啟動(dòng)和停止自動(dòng)啟動(dòng)和停止。應當為授權表中的賬戶(hù)指定密碼。在某些安裝中,該程序自動(dòng)運行。

1、添加mysql用戶(hù)組以及用戶(hù)
        groupadd mysql
        useradd -g mysql mysql

2、解壓mysql 并制定安裝目錄
        cd /root/software/
        tar xvzf mysql-5.1.68.tar.gz
        cd mysql-5.1.68

3、configure
第一次配置  configure
        ./configure --prefix=/usr/local/mysql/ --with-server-suffix=-unionread-edition --enable-assembler --enable-local-infile --enable-thread-safe-client --with-charset=utf8  --with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl --with-embedded-server --with-pthread --with-mysqld-user=mysql --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugins=partition,innobase,innodb_plugin

報錯:
checking for tgetent in -lncursesw... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found

問(wèn)題:configure時(shí)遇到缺少ncurses依賴(lài)包

解決:
查看nucrses并安裝ncurses依賴(lài)包
        yum list|grep ncurses
        yum -y install ncurses-devel


安裝完成以后重新配置 configure
./configure --prefix=/usr/local/mysql/ --with-server-suffix=-unionread-edition --enable-assembler --enable-local-infile --enable-thread-safe-client --with-charset=utf8  --with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl --with-embedded-server --with-pthread --with-mysqld-user=mysql --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugins=partition,innobase,innodb_plugin

Thank you for choosing MySQL! mysql安裝的第一步成功

4、make && make install
報錯:
make[1]: Entering directory `/root/software/mysql-5.1.68/mysys'
source='my_new.cc' object='my_new.o' libtool=no \
        DEPDIR=.deps depmode=none /bin/sh ../depcomp \
        g++ -DDEFAULT_BASEDIR=http://blog.51cto.com/sangebujiangjiu/1868034/\"/home/mysql\" -DMYSQL_DATADIR="http://blog.51cto.com/sangebujiangjiu/1868034/\"/home/mysql/var\"" -DDEFAULT_CHARSET_HOME="http://blog.51cto.com/sangebujiangjiu/1868034/\"/home/mysql\"" -DSHAREDIR="http://blog.51cto.com/sangebujiangjiu/1868034/\"/home/mysql/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR="http://blog.51cto.com/sangebujiangjiu/1868034/\"/home/mysql/etc\"" -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -I.    -O    -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o my_new.cc
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] Error 127
make[1]: Leaving directory `/root/software/mysql-5.1.68/mysys'
make: *** [all-recursive] Error 1

問(wèn)題:g++ not found 。
對比查看發(fā)現GCC已經(jīng)安裝但缺少g++,所以make時(shí)報錯。

安裝gcc-c++
        [root@open2 ~/software]# yum -y install gcc-c++
        
第三次 ./configure
        ./configure --prefix=/usr/local/mysql/ --with-server-suffix=-unionread-edition --enable-assembler --enable-local-infile --enable-thread-safe-client --with-charset=utf8  --with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl --with-embedded-server --with-pthread --with-mysqld-user=mysql --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugins=partition,innobase,innodb_plugin

make && make install
漫長(cháng)的等待。

5、初始化授權表
        /usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql/
copy配置文件:
        cp /usr/local/mysql/share/my-medium.cnf /etc/my.cnf

6、啟動(dòng)mysql服務(wù)
        /usr/local/mysql/bin/mysqld_safe &
設置啟動(dòng)服務(wù)
        cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
        chkconfig --add mysqld
        chkconfig --level 345 mysqld on
#復制mysql啟動(dòng)到用戶(hù)path下
        cp /usr/local/mysql/bin/mysql /usr/bin/mysql
#啟動(dòng)mysql
        service mysqld start
鍵入mysql 或者 全路徑  /usr/local/mysql/bin/mysql
可以登陸了。

免責聲明:本站發(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í)歡迎投稿傳遞力量。

宅男66LU国产在线观看| 亚洲日韩AV无码一区二区三区| 无遮挡啪啪摇乳动态图| 国产亚洲精品拍拍拍拍拍| 欧洲精品成人免费视频在线观看| 国产AV丝袜美腿丝袜|