2. yum安装mysql
[root@evan ~]# yum install mysql mysql-server mysql为客户端,mysql-server为服务端
3. 安装后启动mysqld,进行验证
[root@evan ~]# service mysqld start
Starting mysqld: [ OK ]
[root@evan ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.71 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> 出现如上信息,则是安装完毕。
3. 启动mysql服务
[root@evan ~]# service mysql start
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/evan.pid). 注意,这里启动的服务脚本并不是mysqld,而是mysql,并且,配置文件是/usr/my.cnf,数据目录在/var/lib/mysql下。
查看/var/lib/mysql下的错误日志,发现错误
[Warning] TIMESTAMPwithimplicitDEFAULTvalueisdeprecated. Please use --explicit_defaults_for_timestamp server option
结果又出现错误
+ echo 'The MySQL regression tests may fail if run as root.'
The MySQL regression tests may fail if run as root.
+ echo 'If you really need to build the RPM as root, use'
If you really need to build the RPM as root, use
+ echo '--define='\''runselftest 0'\'' to skip the regression tests.'
--define='runselftest 0' to skip the regression tests.
又是错误,
CMake Error at cmake/build_configurations/mysql_release.cmake:45 (MESSAGE):
aio is required on Linux, you need to install the required library:
Debian/Ubuntu: apt-get install libaio-dev
RedHat/Fedora/Oracle Linux: yum install libaio-devel
SuSE: zypper install libaio-devel
If you really do not want it, pass -DIGNORE_AIO_CHECK to cmake.
Call Stack (most recent call first):
CMakeLists.txt:108 (INCLUDE)
1. 编译安装cmake
[root@evan ~]# tar xf cmake-2.8.12.2.tar.gz
[root@evan cmake-2.8.12.2]# cd cmake-2.8.12.2
[root@evan cmake-2.8.12.2]# ./configure
[root@evan cmake-2.8.12.2]# make && make install
2. 编译安装mysql
[root@evan ~]# groupadd -r mysql
[root@evan ~]# useradd -g mysql -r -d /mydata/data mysql
[root@evan ~]# tar xf mysql-5.6.13.tar.gz
[root@evan mysql-5.6.13]# cd mysql-5.6.13
[root@evan mysql-5.6.13]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/mydata/data \
-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_LIBWRAP=0 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
[root@evan mysql-5.6.13]# make
[root@evan mysql-5.6.13]# make install