一、系統(tǒng)環(huán)境
a、系統(tǒng)Centos 6.5 X64位
創(chuàng)新互聯(lián)主要從事網(wǎng)站設(shè)計、成都做網(wǎng)站、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)花都,10余年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):13518219792
[root@mytest ~]# uname -a
Linux mytest 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
MySQL 文件包: mysql-5.1.72
b、需要軟件
mysql-5.1.72.tar ncurses.tar
二,安裝
對下載的包進行解壓操作安裝:
[root@myser tools]# tar xf mysql-5.1.72.tar.gz
[root@myser alidata]# ls
mysql-5.1.72 mysql-5.1.72.tar.gz
[root@myser tools]# cd mysql-5.1.72
[root@myser mysql-5.1.72]# ./configure --prefix=/application/mysql
在安裝的這里會報錯,提示
checking for termcap functions library... configure: error: No curses/termcap library found
提示缺少curses程序,
[root@myser mysql-5.1.72]# yum install ncurses-devel -y
然后在重新運行上面安裝的命令。[root@myser mysql-5.1.72]# ./configure --prefix=/application/mysql
。。。
。。
/bin/rm: cannot remove `libtoolT': No such file or directory
config.status: executing default commands
Thank you for choosing MySQL!
Remember to check the platform specific part of the reference manual
for hints about installing MySQL on your platform.
Also have a look at the files in the Docs directory.
提示已經(jīng)安裝完成,
現(xiàn)在進行編譯
[root@myser mysql-5.1.72]# make &&make install #這步時間會很長
[root@myser support-files]# pwd
/root/alidata/mysql-5.1.72/support-files
[root@myser mysql-5.1.72]# cd support-files/
[root@myser support-files]# cp my-small.cnf /etc/my.cnf
cp: overwrite /etc/my.cnf'? y
[root@myser support-files]# cp mysql.server.sh /etc/init.d/mysqld[root@myser support-files]# mkdir /application/mysql/data
#創(chuàng)建mysql數(shù)據(jù)文件存放目錄[root@myser support-files]# groupadd mysql
#創(chuàng)建mysql組[root@myser support-files]# useradd -g mysql -M -s /sbin/nologin
#創(chuàng)建mysql用戶屬于mysql組,且不配置家目錄并且不登錄[root@myser support-files]# chown -R mysql.mysql /application/mysql/
#配置data 目錄權(quán)限
三,對數(shù)據(jù)庫初始化操作[root@myser support-files]# /application/mysql/bin/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
WARNING: The host 'myser' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
180102 16:43:02 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
180102 16:43:03 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/application/mysql//bin/mysqladmin -u root password 'new-password'
/application/mysql//bin/mysqladmin -u root -h myser password 'new-password'
Alternatively you can run:
/application/mysql//bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /application/mysql/ ; /application/mysql//bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /application/mysql//mysql-test ; perl mysql-test-run.pl
Please report any problems with the /application/mysql//scripts/mysqlbug script!
[root@myser support-files]# /application/mysql/bin/mysqld_safe &
啟動數(shù)據(jù)庫
[1] 52951
[root@myser support-files]# 180102 16:44:20 mysqld_safe Logging to '/application/mysql/data/myser.err'.
180102 16:44:20 mysqld_safe Starting mysqld daemon with databases from /application/mysql/data
查看是否啟動并檢查端口[root@myser support-files]# netstat -lntpu|grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 53056/mysqld
[root@myser support-files]# chkconfig --add mysqld
[root@myser support-files]# chkconfig mysqld on
[root@myser support-files]# chmod +x /etc/init.d/mysqld
mysql的結(jié)束進程[root@myser support-files]# pkill mysql
第二種啟動mysql
先對mysql文件進行編輯[root@myser tmp]# vi /etc/init.d/mysqld
# overwritten by settings in the MySQL configuration files.
basedir=/application/mysql
datadir=/application/mysql/data
# Default value, in seconds, afterwhich the script should timeout waiting
# for server start.
[root@myser tmp]# vi /etc/profile
PATH="/application/mysql/bin/:$PATH" #添加到文件結(jié)尾:[root@myser tmp]# source /etc/init.d/mysqld
[root@myser tmp]# /etc/init.d/mysqld start
/etc/init.d/mysqld: line 270: @HOSTNAME@: command not found
/etc/init.d/mysqld: line 279: @HOSTNAME@: command not found
Starting MySQL. SUCCESS![root@myser tmp]# /etc/init.d/mysqld stop
/etc/init.d/mysqld: line 270: @HOSTNAME@: command not found
/etc/init.d/mysqld: line 279: @HOSTNAME@: command not found
Shutting down MySQL. SUCCESS!
[root@myser tmp]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN 1368/sshd
tcp 0 0 0.0.0.0:9191 0.0.0.0: LISTEN 1354/procstart
當前標題:mysql-5.1.72安裝配置
標題URL:http://www.rwnh.cn/article38/gpojpp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、網(wǎng)站內(nèi)鏈、微信小程序、品牌網(wǎng)站設(shè)計、網(wǎng)站建設(shè)、網(wǎng)站改版
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)