[root@miner-k ~]# mkdir /mydata/data
[root@miner-k ~]# groupadd -r mysql
[root@miner-k ~]# useradd -r -g mysql -s /sbin/nologin mysql
[root@miner-k ~]# chown -R mysql.mysql /mydata/data/
[root@miner-k ~]# wget https://downloads.mysql.com/archives/get/file/mysql-5.5.59.tar.gz
[root@miner-k ~]# tar -xvf mysql-5.5.59.tar.gz
[root@miner-k ~]# cd mysql-5.5.59
root@localhost mysql-5.5.59]# 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@localhost mysql-5.5.59]# make
[root@localhost mysql-5.5.59]# make install
[root@localhost mysql-5.5.59]# cd /usr/local/mysql
[root@localhost mysql]# chown -R :mysql .
数据库初始化
[root@localhost mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data/
Installing MySQL system tables...
18062110:52:34 [Note] Ignoring --secure-file-priv valueas server is running with --bootstrap.
18062110:52:34 [Note] ./bin/mysqld (mysqld 5.5.59) starting as process 23829 ..
[root@localhost mysql]# vim /etc/profile.d/mysql.sh
export PATH=$PATH:/usr/local/mysql/bin
[root@localhost mysql]# source /etc/profile.d/mysql.sh
mysql的存储引擎
查看数据库支持存储引擎
mysql> show engines;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| CSV | YES | CSV storage engine | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.01 sec)