WIN10下虛擬機:VMware workstation 12 PROhtml
安裝mysql
# 1.查看系統版本
[root@vm-xiluhua][/home/xiluhua]$ cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core)
# 2.到mysql官網下CentOS 7對應的版本,
2.1.選擇社區版(紅框)
# 3.將下載的安裝包放到上傳到/usr/local/mysql文件夾下(本身新建準備),解壓縮
準備工做
1.安裝cmake軟件(用於像weindows那樣客戶選擇安裝參數)
2.安裝依賴包ncurses-devel(須要使用root帳戶操做,否則
3.建立用戶和用戶組
4.解壓安裝包
5.cmake(客戶選擇安裝參數)
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.5.52 \ -DMYSQL_DATADIR=/usr/local/mysql-5.5.52/data \ -DMYSQL_UNIX_ADDR=/usr/local/mysql-5.5.52/tmp/mysql.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \ -DENABLED_LOCAL_INFILE=ON \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_FEDERATED_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ -DWITHOUT_PARTITION_STORAGE_ENGINE=1 \ -DWITH_FAST_MUTEXES=1 \ -DWITH_ZLIB=bundled \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_READLINE=1 \ -DWITH_EMBEDDED_SERVER=1 \ -DWITH_DEBUG=0
6.make & make install(執行客戶選擇的安裝參數)
7.建link ln /application/mysql-5.5.53/ /application/mysql
8.配置初始化文件,support-file/my-small.cnf --> /etc/my.cnf
9.配置環境變量,注意:application配置在前面
10.給安裝目錄配置musql權限chown,chmod -R 17777 /tmp11.進入application/mysql/scripts,初始化 ./mysql_install_db --basedir=/略...12.配置啓動文件mysqld,將support-file/mysql-server cp 到/etc/init.d/mysqld13.修改mysql的root用戶密碼,root初始密碼爲空的:執行命令:./bin/mysqladmin -u root password '密碼'http://www.cnblogs.com/yangjinjin/p/3158226.html