成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

mysql5.6單實(shí)例安裝(二進(jìn)制)

1.下載二進(jìn)制安裝包
MySQL-5.6.39-linux-glibc2.12-x86_64.tar.gz
tar -xvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz

2.拷貝安裝包和配置文件(如果沒有特殊情況,將安裝包解壓放置在該目錄)
cp -rf mysql /usr/local/mysql
cp -rf my5.6.cnf /etc/my.cnf

3.創(chuàng)建mysql用戶
useradd mysql

4.添加數(shù)據(jù)目錄
mkdir -p /home/mysql3306/mysql3306
mkdir -p /home/mysql3306/logs

5.修改目錄權(quán)限
chown mysql:mysql -R /home/mysql3306

6.修改配置文件
socket          = /tmp/mysql.sock(socket文件存放位置)
datadir         = /home/mysql3306/mysql3306(數(shù)據(jù)文件存放目錄)
server-id               = 12013306(設(shè)置serverid 命名規(guī)則:ip后兩位+端口號(hào))
port            = 3306(啟動(dòng)端口)
innodb_buffer_pool_size         = 1024M(innodb buffer pool大小)
*如果是核心節(jié)點(diǎn)單實(shí)例 配置成系統(tǒng)總內(nèi)存的75%左右,如果不是核心節(jié)點(diǎn)則按照具體業(yè)務(wù)壓力來設(shè)置

7.初始化數(shù)據(jù)庫(kù)(確認(rèn)2個(gè)OK)

點(diǎn)擊(此處)折疊或打開

10年積累的網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站制作后付款的網(wǎng)站建設(shè)流程,更有涇源免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

  1. # /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --defaults-file=/etc/my.cnf --datadir=/home/mysql3306/mysql3306 --user=mysql
  2. Installing MySQL system tables...2018-03-10 19:33:26 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  3. 2018-03-10 19:33:26 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
  4. 2018-03-10 19:33:26 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.39-log) starting as process 2041 ...
  5. OK
  6. Filling help tables...2018-03-10 19:33:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  7. 2018-03-10 19:33:37 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
  8. 2018-03-10 19:33:37 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.39-log) starting as process 2063 ...
  9. OK
  10. To start mysqld at boot time you have to copy
  11. support-files/mysql.server to the right place for your system
  12. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
  13. To do so, start the server, then issue the following commands:
  14. /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
  15. /usr/local/mysql/bin/mysqladmin -u root -h mysql5.6 password 'new-password'
  16. Alternatively you can run:
  17. /usr/local/mysql/bin/mysql_secure_installation
  18. which will also give you the option of removing the test
  19. databases and anonymous user created by default. This is
  20. strongly recommended for production servers.
  21. See the manual for more instructions.
  22. You can start the MySQL daemon with:
  23. cd . ; /usr/local/mysql/bin/mysqld_safe &
  24. You can test the MySQL daemon with mysql-test-run.pl
  25. cd mysql-test ; perl mysql-test-run.pl
  26. Please report any problems at http://bugs.mysql.com/
  27. The latest information about MySQL is available on the web at
  28. http://www.mysql.com
  29. Support MySQL by buying support/licenses at http://shop.mysql.com
  30. New default config file was created as /usr/local/mysql/my.cnf and
  31. will be used by default by the server when you start it.
  32. You may edit this file to change server settings
  33. WARNING: Default config file /etc/my.cnf exists on the system
  34. This file will be read by default by the MySQL server
  35. If you do not want to use this, either remove it, or use the
  36. --defaults-file argument to mysqld_safe when starting the server
數(shù)據(jù)目錄下文件

點(diǎn)擊(此處)折疊或打開

  1. [root@mysql5 mysql3306]# ll
  2. total 1574132
  3. -rw-rw----. 1 mysql mysql 1073741824 Mar 10 19:33 ibdata1
  4. -rw-rw----. 1 mysql mysql 268435456 Mar 10 19:33 ib_logfile0
  5. -rw-rw----. 1 mysql mysql 268435456 Mar 10 19:33 ib_logfile1
  6. drwx------. 2 mysql mysql 4096 Mar 10 19:33 mysql
  7. -rw-rw----. 1 mysql mysql 65405 Mar 10 19:33 mysql-bin.000001
  8. -rw-rw----. 1 mysql mysql 1206067 Mar 10 19:33 mysql-bin.000002
  9. -rw-rw----. 1 mysql mysql 38 Mar 10 19:33 mysql-bin.index
  10. drwx------. 2 mysql mysql 4096 Mar 10 19:33 performance_schema
  11. drwx------. 2 mysql mysql 4096 Mar 10 19:33 test

8.啟動(dòng)mysql5.6

點(diǎn)擊(此處)折疊或打開

  1. # /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql &
  2. [1] 2108
  3. [root@mysql5 mysql3306]# 180310 19:40:55 mysqld_safe Logging to '/home/mysql3306/logs/mysql-error.log'.
  4. 180310 19:40:55 mysqld_safe Starting mysqld daemon with databases from /home/mysql3306/mysql3306

點(diǎn)擊(此處)折疊或打開

  1. # ps -ef |grep mysql
  2. avahi 1312 1 0 18:36 ? 00:00:00 avahi-daemon: running [mysql5.local]
  3. root 2108 1821 0 19:40 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql
  4. mysql 2979 2108 7 19:40 pts/0 00:00:06 /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/home/mysql3306/mysql3306 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/home/mysql3306/logs/mysql-error.log --open-files-limit=65535 --pid-file=/home/mysql3306/mysql.pid --socket=/tmp/mysql.sock --port=3306
  5. root 3004 1821 0 19:42 pts/0 00:00:00 grep mysql

9.進(jìn)入mysql5.6

點(diǎn)擊(此處)折疊或打開

  1. # /usr/local/mysql/bin/mysql -S /tmp/mysql.sock
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 1
  4. Server version: 5.6.39-log MySQL Community Server (GPL)
  5. Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  6. Oracle is a registered trademark of Oracle Corporation and/or its
  7. affiliates. Other names may be trademarks of their respective
  8. owners.
  9. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  10. mysql> show databases;
  11. +--------------------+
  12. | Database |
  13. +--------------------+
  14. | information_schema |
  15. | mysql |
  16. | performance_schema |
  17. | test |
  18. +--------------------+
  19. 4 rows in set (0.05 sec)

10.權(quán)限調(diào)整

點(diǎn)擊(此處)折疊或打開

  1. mysql> select user,host,password from mysql.user;
  2. ERROR 2006 (HY000): MySQL server has gone away
  3. No connection. Trying to reconnect...
  4. Connection id: 2
  5. Current database: *** NONE ***
  6. +------+-----------+----------+
  7. | user | host | password |
  8. +------+-----------+----------+
  9. | root | localhost | |
  10. | root | mysql5.6 | |
  11. | root | 127.0.0.1 | |
  12. | root | ::1 | |
  13. | | localhost | |
  14. | | mysql5.6 | |
  15. +------+-----------+----------+
  16. 6 rows in set (0.08 sec)
刪除空用戶
mysql> delete from mysql.user where user='';
Query OK, 2 rows affected (0.06 sec)
mysql> delete from mysql.user where host in ('::1','tomato02');
Query OK, 1 row affected (0.02 sec)

使生效
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

賦權(quán)限
mysql> grant all on *.* to root@'localhost' identified by 'root';
Query OK, 0 rows affected (0.04 sec)
mysql> grant all on *.* to root@'%' identified by 'root';
Query OK, 0 rows affected (0.01 sec)

-all 所有權(quán)限
-*.* 所有權(quán)限的(所有庫(kù)的所有表)
-root@'localhost'  用戶@網(wǎng)段  localhost通過sock訪問數(shù)據(jù)庫(kù),通過本地方式訪問數(shù)據(jù)庫(kù)
-root@'%'           通過TCP/IP協(xié)議來訪問數(shù)據(jù)庫(kù),TCP/IP可以遠(yuǎn)程訪問
-identified by 'root';   密碼root

使用密碼登錄數(shù)據(jù)庫(kù)
# /usr/local/mysql/bin/mysql -S /tmp/mysql.sock -p
Enter password:

查看幫助

點(diǎn)擊(此處)折疊或打開

  1. # /usr/local/mysql/bin/mysql --help
  2. /usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.6.39, for linux-glibc2.12 (x86_64) using EditLine wrapper
  3. Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  4. Oracle is a registered trademark of Oracle Corporation and/or its
  5. affiliates. Other names may be trademarks of their respective
  6. owners.
  7. Usage: /usr/local/mysql/bin/mysql [OPTIONS] [database]
  8. -?, --help Display this help and exit.
  9. -I, --help Synonym for -?
  10. --auto-rehash Enable automatic rehashing. One doesn't need to use
  11. 'rehash' to get table and field completion, but startup
  12. and reconnecting may take a longer time. Disable with
  13. --disable-auto-rehash.
  14. (Defaults to on; use --skip-auto-rehash to disable.)
  15. -A, --no-auto-rehash
  16. No automatic rehashing. One has to use 'rehash' to get
  17. table and field completion. This gives a quicker start of
  18. mysql and disables rehashing on reconnect.
  19. --auto-vertical-output
  20. Automatically switch to vertical output mode if the
  21. result is wider than the terminal width.
  22. -B, --batch Don't use history file. Disable interactive behavior.
  23. (Enables --silent.)
  24. --bind-address=name IP address to bind to.
  25. -b, --binary-as-hex Print binary data as hex
  26. --character-sets-dir=name
  27. Directory for character set files.
  28. --column-type-info Display column type information.
  29. -c, --comments Preserve comments. Send comments to the server. The
  30. default is --skip-comments (discard comments), enable
  31. with --comments.
  32. -C, --compress Use compression in server/client protocol.
  33. -#, --debug[=#] This is a non-debug version. Catch this and exit.
  34. --debug-check Check memory and open file usage at exit.
  35. -T, --debug-info Print some debug info at exit.
  36. -D, --database=name Database to use.
  37. --default-character-set=name
  38. Set the default character set.
  39. --delimiter=name Delimiter to be used.
  40. --enable-cleartext-plugin
  41. Enable/disable the clear text authentication plugin.
  42. -e, --execute=name Execute command and quit. (Disables --force and history
  43. file.)
  44. -E, --vertical Print the output of a query (rows) vertically.
  45. -f, --force Continue even if we get an SQL error.
  46. -G, --named-commands
  47. Enable named commands. Named commands mean this program's
  48. internal commands; see mysql> help . When enabled, the
  49. named commands can be used from any line of the query,
  50. otherwise only from the first line, before an enter.
  51. Disable with --disable-named-commands. This option is
  52. disabled by default.
  53. -i, --ignore-spaces Ignore space after function names.
  54. --init-command=name SQL Command to execute when connecting to MySQL server.
  55. Will automatically be re-executed when reconnecting.
  56. --local-infile Enable/disable LOAD DATA LOCAL INFILE.
  57. -b, --no-beep Turn off beep on error.
  58. -h, --host=name Connect to host.
  59. -H, --html Produce HTML output.
  60. -X, --xml Produce XML output.
  61. --line-numbers Write line numbers for errors.
  62. (Defaults to on; use --skip-line-numbers to disable.)
  63. -L, --skip-line-numbers
  64. Don't write line number for errors.
  65. -n, --unbuffered Flush buffer after each query.
  66. --column-names Write column names in results.
  67. (Defaults to on; use --skip-column-names to disable.)
  68. -N, --skip-column-names
  69. Don't write column names in results.
  70. --sigint-ignore Ignore SIGINT (CTRL-C).
  71. -o, --one-database Ignore statements except those that occur while the
  72. default database is the one named at the command line.
  73. --pager[=name] Pager to use to display results. If you don't supply an
  74. option, the default pager is taken from your ENV variable
  75. PAGER. Valid pagers are less, more, cat [> filename],
  76. etc. See interactive help (\h) also. This option does not
  77. work in batch mode. Disable with --disable-pager. This
  78. option is disabled by default.
  79. -p, --password[=name]
  80. Password to use when connecting to server. If password is
  81. not given it's asked from the tty.
  82. -P, --port=# Port number to use for connection or 0 for default to, in
  83. order of preference, my.cnf, $MYSQL_TCP_PORT,
  84. /etc/services, built-in default (3306).
  85. --prompt=name Set the mysql prompt to this value.
  86. --protocol=name The protocol to use for connection (tcp, socket, pipe,
  87. memory).
  88. -q, --quick Don't cache result, print it row by row. This may slow
  89. down the server if the output is suspended. Doesn't use
  90. history file.
  91. -r, --raw Write fields without conversion. Used with --batch.
  92. --reconnect Reconnect if the connection is lost. Disable with
  93. --disable-reconnect. This option is enabled by default.
  94. (Defaults to on; use --skip-reconnect to disable.)
  95. -s, --silent Be more silent. Print results with a tab as separator,
  96. each row on new line.
  97. -S, --socket=name The socket file to use for connection.
  98. --ssl Enable SSL for connection (automatically enabled with
  99. other flags).
  100. --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
  101. --ssl).
  102. --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl).
  103. --ssl-cert=name X509 cert in PEM format (implies --ssl).
  104. --ssl-cipher=name SSL cipher to use (implies --ssl).
  105. --ssl-key=name X509 key in PEM format (implies --ssl).
  106. --ssl-crl=name Certificate revocation list (implies --ssl).
  107. --ssl-crlpath=name Certificate revocation list path (implies --ssl).
  108. --ssl-verify-server-cert
  109. Verify server's "Common Name" in its cert against
  110. hostname used when connecting. This option is disabled by
  111. default.
  112. --ssl-mode=name SSL connection mode.
  113. -t, --table Output in table format.
  114. --tee=name Append everything into outfile. See interactive help (\h)
  115. also. Does not work in batch mode. Disable with
  116. --disable-tee. This option is disabled by default.
  117. -u, --user=name User for login if not current user.
  118. -U, --safe-updates Only allow UPDATE and DELETE that uses keys.
  119. -U, --i-am-a-dummy Synonym for option --safe-updates, -U.
  120. -v, --verbose Write more. (-v -v -v gives the table output format).
  121. -V, --version Output version information and exit.
  122. -w, --wait Wait and retry if connection is down.
  123. --connect-timeout=# Number of seconds before connection timeout.
  124. --max-allowed-packet=#
  125. The maximum packet length to send to or receive from
  126. server.
  127. --net-buffer-length=#
  128. The buffer size for TCP/IP and socket communication.
  129. --select-limit=# Automatic limit for SELECT when using --safe-updates.
  130. --max-join-size=# Automatic limit for rows in a join when using
  131. --safe-updates.
  132. --secure-auth Refuse client connecting to server if it uses old
  133. (pre-4.1.1) protocol.
  134. (Defaults to on; use --skip-secure-auth to disable.)
  135. --server-arg=name Send embedded server this as a parameter.
  136. --show-warnings Show warnings after every statement.
  137. --plugin-dir=name Directory for client-side plugins.
  138. --default-auth=name Default authentication client-side plugin to use.
  139. --histignore=name A colon-separated list of patterns to keep statements
  140. from getting logged into mysql history.
  141. --binary-mode By default, ASCII '\0' is disallowed and '\r\n' is
  142. translated to '\n'. This switch turns off both features,
  143. and also turns off parsing of all clientcommands except
  144. \C and DELIMITER, in non-interactive mode (for input
  145. piped to mysql or loaded using the 'source' command).
  146. This is necessary when processing output from mysqlbinlog
  147. that may contain blobs.
  148. --connect-expired-password
  149. Notify the server that this client is prepared to handle
  150. expired password sandbox mode.
  151. Default options are read from the following files in the given order:
  152. /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
  153. The following groups are read: mysql client
  154. The following options may be given as the first argument:
  155. --print-defaults Print the program argument list and exit.
  156. --no-defaults Don't read default options from any option file,
  157. except for login file.
  158. --defaults-file=# Only read default options from the given file #.
  159. --defaults-extra-file=# Read this file after the global files are read.
  160. --defaults-group-suffix=#
  161. Also read groups with concat(group, suffix)
  162. --login-path=# Read this path from the login file.
  163. Variables (--variable-name=value)
  164. and boolean options {FALSE|TRUE} Value (after reading options)
  165. --------------------------------- ----------------------------------------
  166. auto-rehash TRUE
  167. auto-vertical-output FALSE
  168. bind-address (No default value)
  169. binary-as-hex FALSE
  170. character-sets-dir (No default value)
  171. column-type-info FALSE
  172. comments FALSE
  173. compress FALSE
  174. debug-check FALSE
  175. debug-info FALSE
  176. database (No default value)
  177. default-character-set utf8
  178. delimiter ;
  179. enable-cleartext-plugin FALSE
  180. vertical FALSE
  181. force FALSE
  182. named-commands FALSE
  183. ignore-spaces FALSE
  184. init-command (No default value)
  185. local-infile FALSE
  186. no-beep FALSE
  187. host (No default value)
  188. html FALSE
  189. xml FALSE
  190. line-numbers TRUE
  191. unbuffered FALSE
  192. column-names TRUE
  193. sigint-ignore FALSE
  194. port 3306
  195. prompt mysql>
  196. quick FALSE
  197. raw FALSE
  198. reconnect TRUE
  199. socket /tmp/mysql.sock
  200. ssl FALSE
  201. ssl-ca (No default value)
  202. ssl-capath (No default value)
  203. ssl-cert (No default value)
  204. ssl-cipher (No default value)
  205. ssl-key (No default value)
  206. ssl-crl (No default value)
  207. ssl-crlpath (No default value)
  208. ssl-verify-server-cert FALSE
  209. table FALSE
  210. user (No default value)
  211. safe-updates FALSE
  212. i-am-a-dummy FALSE
  213. connect-timeout 0
  214. max-allowed-packet 16777216
  215. net-buffer-length 16384
  216. select-limit 1000
  217. max-join-size 1000000
  218. secure-auth FALSE
  219. show-warnings FALSE
  220. plugin-dir (No default value)
  221. default-auth (No default value)
  222. histignore (No default value)
  223. binary-mode FALSE
  224. connect-expired-password FALSE

11.關(guān)閉mysql

點(diǎn)擊(此處)折疊或打開

  1. # /usr/local/mysql/bin/mysqladmin -uroot -proot -S /tmp/mysql.sock shutdown
  2. Warning: Using a password on the command line interface can be insecure.
  3. 180310 20:36:38 mysqld_safe mysqld from pid file /home/mysql3306/mysql.pid ended
  4. [1]+ Done /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql
強(qiáng)行關(guān)閉mysql
pkill mysql

12.mysql錯(cuò)誤日志
/home/mysql3306/logs/mysql-error.log








網(wǎng)頁(yè)題目:mysql5.6單實(shí)例安裝(二進(jìn)制)
鏈接分享:http://jinyejixie.com/article44/ijjehe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、網(wǎng)站改版、品牌網(wǎng)站建設(shè)軟件開發(fā)、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都做網(wǎng)站
会泽县| 山东| 崇文区| 榆树市| 鲁甸县| 阿拉善左旗| 东山县| 新兴县| 南阳市| 遂溪县| 石首市| 永康市| 伊吾县| 浮梁县| 漠河县| 博客| 商河县| 苏尼特右旗| 灵石县| 蒙自县| 巴中市| 阿克| 吉水县| 肇庆市| 平顶山市| 房山区| 溧水县| 辽源市| 伊川县| 内江市| 定日县| 成安县| 高碑店市| 广水市| 济南市| 康定县| 金溪县| 呼玛县| 鹿邑县| 安仁县| 葫芦岛市|