[root@localhost local]# yum install gcc-c++
[root@localhost local]# yum install ncurses-devel
[root@localhost]# tar -zxv -f cmake-2.8.10.2.tar.gz // 解壓壓縮包
[root@localhost local]# cd cmake-2.8.10.2
[root@localhost cmake-2.8.10.2]# ./configure
[root@localhost cmake-2.8.10.2]# make
[root@localhost cmake-2.8.10.2]# make install
用vi在檔案/etc/profile檔案中增加變數,使其永久有效,
[root@localhost local]# vi /etc/profile
在檔案末尾追加以下兩行**:
path=/usr/local/cmake-2.8.10.2/bin:$path
export path
執行以下**使剛才的修改生效:
[root@localhost local]# source /etc/profile
用 export 命令檢視path值
[root@localhost local]# echo $path
[root@localhost]# mkdir -p /usr/local/mysql //安裝mysql
[root@localhost]# mkdir -p /usr/local/mysql/data //存放資料庫
[root@localhost] groupadd mysql
[root@localhost] useradd -r -g mysql mysql
[root@localhost local]# tar -zxv -f mysql-5.5.29.tar.gz //解壓
[root@localhost local]# cd mysql-5.5.29
[root@localhost mysql-5.5.29]#
cmake -dcmake_install_prefix=/usr/local/mysql \
-dmysql_unix_addr=/usr/local/mysql/mysql.sock \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_readline=1 \
-denabled_local_infile=1 \
-dmysql_datadir=/usr/local/mysql/data \
-dmysql_user=mysql \
-dmysql_tcp_port=3306
[root@localhost mysql-5.5.29]# make
[root@localhost mysql-5.5.29]# make install
[root@localhost mysql-5.5.29]# cd /usr/local/mysql/
[root@localhost mysql]# ls
bin copying data docs include install-binary lib man mysql-test readme scripts share sql-bench support-files
有bin等以上檔案的話,恭喜你已經成功安裝了mysql。
[root@localhost mysql]# cd /usr/local/mysql //把當前目錄中所有檔案的所有者設為root,所屬組為mysql
[root@localhost mysql]# chown -r root:mysql .
[root@localhost mysql]# chown -r mysql:mysql data
[root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf
cp:是否覆蓋"/etc/my.cnf"? y
[root@localhost mysql]# cd /usr/local/mysql
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
[root@localhost ~]# vi /root/.bash_profile
在修改path=$path:$home/bin為:
path=$path:$home/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
[root@localhost ~]# source /root/.bash_profile //使剛才的修改生效
[root@localhost ~]# cd /usr/local/mysql
[root@localhost mysql]# ./bin/mysqld_safe --user=mysql & //啟動mysql,但不能停止
mysqladmin -u root -p shutdown //此時root還沒密碼,所以為空值,提示輸入密碼時,直接回車即可。
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysql
[root@localhost mysql]# service mysql start
starting mysql... error! the server quit without updating pid file (/usr/local/mysql/data/localhost.localdomain.pid).
啟動失敗:
我這裡是許可權問題,先改變許可權
[root@localhost mysql]# chown -r mysql:mysql /usr/local/mysql
接著啟動伺服器
[root@localhost mysql]# /etc/init.d/mysql start
[root@localhost mysql]# mysql -u root mysql
mysql> use mysql;
mysql> desc user;
mysql> grant all privileges on *.* to root@"%" identified by "root"; //為root新增遠端連線的能力
mysql> update user set password = password('123456') where user='root'; //設定root使用者密碼
mysql> select host,user,password from user where user='root';
mysql> flush privileges;
mysql> exit
[root@localhost mysql]# mysql -u root -p
enter password:123456
若還不能進行遠端連線,關閉防火牆
[root@localhost]# /etc/rc.d/init.d/iptables stop
question:
1. /etc/init.d/mysql restart (xx.pid not found xx )
error_ log : /usr/local/mysql/bin/mysqld: unknown variable 'default-collation=utf8_bin'
2 不需要輸入密碼
vi /etc/my.cnf
[mysqld]
port = 3306
socket = /usr/local/var/mysql.sock
basedir =/usr/local/mysql
datadir =/usr/local/mysql/data
skip-external-locking
#skip-locking
key_buffer_size = 32m
max_allowed_packet = 16m
table_open_cache = 128
sort_buffer_size = 2m
read_buffer_size = 1m
read_rnd_buffer_size = 4m
#net_buffer_length = 2k
#thread_stack = 128k
skip-grant-tables
CentOS安裝 公升級 git
本篇內容是以centos 7為例來做演示,與他版本的os某些命令和檔名有異,但大致過程基本類似,可作為參照。另外以centos 7為界限,7以前的版本 如6 與7 包含 往後的版本某些命令也有差異 服務啟停命令 以關閉防火牆為例 用 yum 安裝 git root auto yum y instal...
mysql安裝公升級
1.1安裝方法比較 1.2 rpm 安裝步驟 shell rpm ivh mysql server 5.5.i386.rpm shell rpm ivh mysql client 5.5.i386.rpm 1.3 二進位制安裝步驟 root 登陸,執行如下步驟 shell groupadd mysq...
mysql公升級 rpm安裝
mysql版本5.7.29公升級到5.7.30 由於我們安裝mysql的方式是通過mysql 5.7.29 1.el7.x86 64.rpm bundle.tar中的rpm包安裝 rpm uvh mysql community rpm 所以公升級的方式是專門針對這種方式的.其實公升級的過程跟從0開始...