cd /usr/local/src
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.20.tar.gz
tar -zxvf pcre-8.20.tar.gz
cd pcre-8.20
./configure
make
make install
cd /usr/local/src
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install
cd /usr/local/src
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
tar -zxvf openssl-1.0.1g.tar.gz
cd /usr/local/src
wget http://nginx.org/download/nginx-1.6.0.tar.gz
tar -zxvf nginx-1.6.0tar.gz
cd nginx-1.6.0
cd /tmp
tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./bootstrap
make
make install
cd /tmp
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
#./stdio.h:1012:1: error: 'gets' undeclared here (not in a function)
#解决:sed -i '/gets is a security hole/d' lib/stdio.in.h
make install
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
cd /tmp
tar xvf mysql-5.5.15.tar.gz
cd mysql-5.5.15/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/var/mysql/data \
-DMYSQL_USER=mysql
make
make install
vi /etc/init.d/mysqld(编辑此文件,查找并修改以下变量内容:)
basedir=/usr/local/mysql
datadir=/var/mysql/data
chkconfig --add mysqld
chkconfig --level 345 mysqld on
启动服务:
chkconfig --add mysqld
chkconfig --level 345 mysqld on
启动服务:
service mysqld start
设置密码:
/usr/local/mysql/bin/mysqladmin password [new-password]
#新安装mysql 第三方工具连接不上问题
#报的错误为
#ERROR 1130: Host ’192.168.5.3’ is not allowed to connect to this MySQL server
#登上服务器
mysql -h localhost -u root -p
Enter password: ***
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.43-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
www.iyunv.com
mysql> grant all privileges on *.* to root@'%' identified by '123' with grant
-> option;