您好,登錄后才能下訂單哦!
準備環境:Centos6.5(6系列操作系統)
[root@localhost ~]# yum -y install gcc gcc-c++ ncurses-devel libxml2-devel zlib-devel pcre-devel
[root@localhost ~]# tar zxvf bison-2.5.tar.gz
[root@localhost ~]# cd bison-2.5
[root@localhost ~]# ./configure &&make &&make install
[root@localhost ~]# tar zxvf cmake-2.8.7.tar.gz
[root@localhost ~]# cd cmake-2.8.7
[root@localhost ~]# ./bootstrap &&gmake &&gmake install
[root@localhost ~]# tar zxvf mysql-5.5.22.tar.gz
[root@localhost ~]# cd mysql-5.5.22
[root@localhost ~]# useradd mysql
[root@localhost ~]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DSYSCONFDIR=/etc/ &&make &&make install
參數注釋:安裝目錄、默認編碼、校驗字符集、安裝所有擴展字符集、配置文件目錄
[root@localhost ~]# chown -R :mysql /usr/local/mysql
[root@localhost ~]# cd /usr/local/mysql/support-files
[root@localhost ~]# cp my-medium.cnf /etc/my.cnf
[root@localhost ~]# cp mysql.server /etc/init.d/mysqld
[root@localhost ~]# cd ../scripts/
下面操作將進行mysql初始化,指定基礎目錄,存放數據目錄,及運行用戶
[root@localhost ~]# ./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
[root@localhost ~]# /etc/init.d/mysqld start
[root@localhost ~]# echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
[root@localhost ~]# source /etc/profile
[root@localhost ~]# mysqladmin -u root password 'redhat' 設置mysql運行賬戶及密碼,這個root可不是系統用戶的root哦!
[root@localhost ~]# mysql -u root -p
Enter password:
OK,安裝完成
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。