国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

MySQL源碼編譯安裝(Aliyun Linux版)

2019-11-09 13:34:13
字體:
來源:轉載
供稿:網友

安裝前的準備工作,工具包的安裝

# yum -y install gcc libxml2-dev curl screen /libpng12-dev autoconf libpcre3-dev make bzip2 /libevent-dev patch libjpeg62-dev libcurl4-openssl-dev /libfreetype6-dev g++ libtool libncurses5-dev psmisc lrzsz

以下安裝中涉及的幾點需要提前說明的問題:

1. 所有下載的文件將保存在 /usr/local/software/ 目錄下

2. MySQL 將以mysql用戶運行,而且將加入 service 開機自動運行

3. mysql 將被安裝在 /usr/local/mysql/ 目錄下

4. mysql 默認安裝使用utf8 字符集

5. mysql 的數據和日志文件保存在 /var/mysql/ 對應目錄下

6. mysql 的配置文件保存于/var/mysql/my.cnf

自行下載安裝包:

m4-1.4.18.tar.gz

bison-2.5.tar.gz

cmake-2.8.8.tar.gz

mysql-5.6.10.tar.gz

首先可以查看下是否安裝了 cmake # rpm -qa |grep cmake

安裝 m4

# cd /usr/local/software# tar zxvf m4-1.4.18.tar.gz# cd m4-1.4.18# ./configure# make && make install

安裝 cmake

# cd /usr/local/software# tar zxvf cmake-2.8.8.tar.gz# cd cmake-2.8.8# ./bootstrap# make && make install

安裝 bison

# tar zxvf bison-2.5.tar.gz# cd bison-2.5# ./configure# make && make install

創建mysql用戶及用戶組

# groupadd mysql# useradd -r -g mysql mysql

編譯安裝 MySQL

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql /-DMYSQL_UNIX_ADDR=/tmp/mysql.sock /-DDEFAULT_CHARSET=utf8 /-DDEFAULT_COLLATION=utf8_general_ci /-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk /-DWITH_MYISAM_STORAGE_ENGINE=1 /-DWITH_INNOBASE_STORAGE_ENGINE=1 /-DWITH_MEMORY_STORAGE_ENGINE=1 /-DWITH_READLINE=1 /-DENABLED_LOCAL_INFILE=1 /-DENABLE_DOWNLOADS=1 /-DMYSQL_DATADIR=/var/mysql/data /-DMYSQL_USER=mysql

接下來,安裝:
# make && make install

注意事項:

重新編譯時,需要清除舊的對象文件和緩存信息。

# make clean# rm -f CMakeCache.txt# rm -rf /etc/my.cnf

參數說明:

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql  //安裝目錄

-DINSTALL_DATADIR=/usr/local/mysql/data  //數據庫存放目錄

-DDEFAULT_CHARSET=utf8                   //使用utf8字符

-DDEFAULT_COLLATION=utf8_general_ci      //校驗字符

-DEXTRA_CHARSETS=all                     //安裝所有擴展字符集

-DENABLED_LOCAL_INFILE=1                 //允許從本地導入數據

分配權限:

# chmod +w /usr/local/mysql# chown -R mysql:mysql /usr/local/mysql# ln -s/usr/local/mysql/lib/libmysqlclient.so.18# /usr/lib/libmysqlclient.so.18

創建相應的目錄:

# mkdir -p /var/mysql/# mkdir -p /var/mysql/data/# mkdir -p /var/mysql/log/

# chown -R mysql:mysql /var/mysql/# cd support-files/

# cp my-default.cnf /var/mysql/my.cnf# cp mysql.server /etc/init.d/mysqld

 配置啟動MySQL

# /usr/local/mysql/scripts/mysql_install_db /--defaults-file=/var/mysql/my.cnf /--basedir=/usr/local/mysql /--datadir=/var/mysql/data /--user=mysql

Installing MySQL system tables...2017-02-07 10:29:30 26889 [Note] InnoDB: The InnoDB memory heap is disabled2017-02-07 10:29:30 26889 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2017-02-07 10:29:30 26889 [Note] InnoDB: Compressed tables use zlib 1.2.32017-02-07 10:29:30 26889 [Note] InnoDB: CPU does not support crc32 instructions2017-02-07 10:29:30 26889 [Note] InnoDB: Initializing buffer pool, size = 128.0M2017-02-07 10:29:30 26889 [Note] InnoDB: Completed initialization of buffer pool2017-02-07 10:29:30 26889 [Note] InnoDB: Highest supported file format is Barracuda.2017-02-07 10:29:30 26889 [Note] InnoDB: 128 rollback segment(s) are active.2017-02-07 10:29:30 26889 [Note] InnoDB: Waiting for purge to start2017-02-07 10:29:30 26889 [Note] InnoDB: 1.2.10 started; log sequence number 16260372017-02-07 10:29:30 26889 [Note] Binlog end2017-02-07 10:29:30 26889 [Note] InnoDB: FTS optimize thread exiting.2017-02-07 10:29:30 26889 [Note] InnoDB: Starting shutdown...2017-02-07 10:29:31 26889 [Note] InnoDB: Shutdown completed; log sequence number 1626047OKFilling help tables...2017-02-07 10:29:31 26914 [Note] InnoDB: The InnoDB memory heap is disabled2017-02-07 10:29:31 26914 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2017-02-07 10:29:31 26914 [Note] InnoDB: Compressed tables use zlib 1.2.32017-02-07 10:29:31 26914 [Note] InnoDB: CPU does not support crc32 instructions2017-02-07 10:29:31 26914 [Note] InnoDB: Initializing buffer pool, size = 128.0M2017-02-07 10:29:31 26914 [Note] InnoDB: Completed initialization of buffer pool2017-02-07 10:29:31 26914 [Note] InnoDB: Highest supported file format is Barracuda.2017-02-07 10:29:31 26914 [Note] InnoDB: 128 rollback segment(s) are active.2017-02-07 10:29:31 26914 [Note] InnoDB: Waiting for purge to start2017-02-07 10:29:31 26914 [Note] InnoDB: 1.2.10 started; log sequence number 16260472017-02-07 10:29:32 26914 [Note] Binlog end2017-02-07 10:29:32 26914 [Note] InnoDB: FTS optimize thread exiting.2017-02-07 10:29:32 26914 [Note] InnoDB: Starting shutdown...2017-02-07 10:29:33 26914 [Note] InnoDB: Shutdown completed; log sequence number 1626057OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWord FOR THE MySQL root USER !To do so, start the server, then issue the following commands:  /usr/local/mysql/bin/mysqladmin -u root password 'new-password'  /usr/local/mysql/bin/mysqladmin -u root -h iZ2zeg8zidyvg3jc1r0g6bZ password 'new-password'Alternatively you can run:  /usr/local/mysql/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default.  This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:  cd . ; /usr/local/mysql/bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.pl  cd mysql-test ; perl mysql-test-run.plPlease report any problems with the ./bin/mysqlbug script!The latest information about MySQL is available on the web at  http://www.mysql.comSupport MySQL by buying support/licenses at http://shop.mysql.comWARNING: Found existing config file /usr/local/mysql/my.cnf on the system.Because this file might be in use, it was not replaced,but was used in bootstrap (unless you used --defaults-file)and when you later start the server.The new default config file was created as /usr/local/mysql/my-new.cnf,please compare it with your file and take the changes you need.

將 mysql 加入開機啟動

chmod +x /etc/init.d/mysqldvi /etc/init.d/mysqld (編輯此文件,查找并修改以下變量內容:)basedir=/usr/local/mysqldatadir=/var/mysql/datachkconfig --add mysqldchkconfig --level 345 mysqld on

啟動 mysql

# service mysqld start

Starting MySQL...[OK]

設置root用戶的密碼

/usr/local/mysql/bin/mysqladmin -u root password 'wise83680688!@#'

使用root用戶登錄

# /usr/local/mysql/bin/mysql -uroot -p

Enter password:【輸入密碼】

Welcome to the MySQL monitor.  Commands end with ; or /g.Your MySQL connection id is 5Server version: 5.6.10 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql> 

至此,已經使用root用戶和密碼進行mysql的登錄了。可以開始使用了。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 仁化县| 灌南县| 中西区| 宁强县| 哈密市| 家居| 陈巴尔虎旗| 秦安县| 五莲县| 中西区| 和林格尔县| 阿尔山市| 江安县| 通渭县| 黔西| 冀州市| 称多县| 郎溪县| 稷山县| 江津市| 青浦区| 怀柔区| 民勤县| 宕昌县| 江源县| 新余市| 盐城市| 荥阳市| 遵义市| 错那县| 云南省| 柳江县| 雷州市| 肥西县| 上饶市| 离岛区| 昌吉市| 望江县| 本溪市| 绥化市| 株洲县|