MySQL 最新版本5 6 13源码安装过程

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

2个月前公司给DBA的测试服务器被收回去了,一直跟开发用一组DB,有些需要测试的小功能,需要不断重启db,为了不影响开发同事,自己又申请了一个虚拟机,准备安装最新的5.6.13版本的MySQL社区版。


1 download the tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz/from/http://cdn.mysql.com/


2 安装cmake软件包
yum install cmake


3 create account of mysql
groupadd mysql           
useradd -g mysql mysql           
autoreconf --force --install
libtoolize --automake --force
automake --force --add-missing


4  complie the sources
mkdir -p /data/mbdata
tar -xvf mysql-5.6.13.tar.gz 


5 cmake

 time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci


[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.6.4
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!


real    0m0.017s
user    0m0.006s
sys     0m0.005s


6 上一步cmake报错了,google得知需要重新yum make下

yum install make
ok


再继续去cmake
[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.6.4
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- MySQL 5.6.13
-- Packaging as: mysql-5.6.13-Linux-x86_64
-- Could NOT find Threads  (missing:  Threads_FOUND)
-- Could NOT find Threads  (missing:  Threads_FOUND)
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:31 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:621 (TEST_BIG_ENDIAN)
  CMakeLists.txt:314 (INCLUDE)

这个错误很诡异,google上面有很多,但是每种情况都不同,我只好一个个去try了


-- Configuring incomplete, errors occurred!


real    0m0.122s
user    0m0.067s
sys     0m0.048s
[root@472322 mysql-5.6.13]# 


报错如下: CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.
 没有安装 gcc 和 gcc-c++,执行cmake报如上错误:
 第一次尝试,执行
yum install -y gcc
yum install -y gcc-c++

Ok,yum成功


7  继续cmake

time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

[root@472322 mysql-5.6.13]# 
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.6.4
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- MySQL 5.6.13
-- Packaging as: mysql-5.6.13-Linux-x86_64
-- Could NOT find Threads  (missing:  Threads_FOUND)
-- Could NOT find Threads  (missing:  Threads_FOUND)
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:31 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:621 (TEST_BIG_ENDIAN)
  CMakeLists.txt:314 (INCLUDE)




-- Configuring incomplete, errors occurred!


real    0m0.510s
user    0m0.275s
sys     0m0.112s


第二次尝试,有人说需要安装至少5种包
[root@472322 mysql-5.6.13]# 
yum install gcc gcc-c++
    yum install -y ncurses-devel.x86_64
    yum install -y cmake.x86_64
    yum install -y libaio.x86_64
    yum install -y bison.x86_64
yum install -y gcc-c++.x86_64

然后再cmake,还是报原来的错误


最后决定用土办法了,删除所有的已经安装过的,重新再来做一遍吧。

[解决办法]:删除原来的mysql-5.6.13目录,重新解压缩tar.gz包


rm -rf /root/mysql-5.6.13
cd /root/
tar -xvf mysql-5.6.13.tar.gz 
cd /root/mysql-5.6.13
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
........
-- Looking for asprintf
-- Looking for asprintf - found
-- Check size of pthread_t
-- Check size of pthread_t - done
-- Using cmake version 2.6.4
-- Not building NDB
-- Performing Test HAVE_PEERCRED
-- Performing Test HAVE_PEERCRED - Success
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
-- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://foo.bar.com:80
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
-- Configuring done
-- Generating done
-- Build files have been written to: /root/mysql-5.6.13


real    0m23.413s
user    0m13.815s
sys     0m7.419s

OK,成功了,对linux底层不太熟悉,难道是因为前面没有事先安装好各种包而cmake出来错误的东西导致后面继续cmake就一直报错吗? 是否是需要准备好各种lib包然后才能yum install cmake呢?然后再安装mysql才能不报错呢?



8 build the db directy
time make 
time make install


9 init db
ll /usr/local/mysql56/
cd /usr/local/mysql56/
chown -R mysql .
chgrp -R mysql .
cp support-files/my-default.cnf /etc/my56.cnf
scripts/mysql_install_db  --user=mysql --basedir=/usr/local/mysql56 --datadir=/data56 --defaults-file=/etc/my56.cnf
[root@472322 mysql56]# scripts/mysql_install_db  --user=mysql --basedir=/usr/local/mysql56 --datadir=/data56 --defaults-file=/etc/my56.cnf
Installing MySQL system tables...2013-08-22 05:06:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-08-22 05:06:03 19416 [Note] InnoDB: The InnoDB memory heap is disabled
2013-08-22 05:06:03 19416 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-08-22 05:06:03 19416 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-08-22 05:06:03 19416 [Note] InnoDB: Using CPU crc32 instructions
2013-08-22 05:06:03 19416 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-08-22 05:06:03 19416 [Note] InnoDB: Completed initialization of buffer pool
2013-08-22 05:06:03 19416 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-08-22 05:06:03 19416 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-08-22 05:06:03 19416 [Note] InnoDB: Database physically writes the file full: wait...
2013-08-22 05:06:03 19416 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-08-22 05:06:03 19416 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-08-22 05:06:03 19416 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-08-22 05:06:03 19416 [Warning] InnoDB: New log files created, LSN=45781
2013-08-22 05:06:03 19416 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-08-22 05:06:03 19416 [Note] InnoDB: Doublewrite buffer created
2013-08-22 05:06:03 19416 [Note] InnoDB: 128 rollback segment(s) are active.
2013-08-22 05:06:03 19416 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-08-22 05:06:03 19416 [Note] InnoDB: Foreign key constraint system tables created
2013-08-22 05:06:03 19416 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-08-22 05:06:03 19416 [Note] InnoDB: Tablespace and datafile system tables created.
2013-08-22 05:06:03 19416 [Note] InnoDB: Waiting for purge to start
2013-08-22 05:06:03 19416 [Note] InnoDB: 5.6.13 started; log sequence number 0
2013-08-22 05:06:04 19416 [Note] Binlog end
2013-08-22 05:06:04 19416 [Note] InnoDB: FTS optimize thread exiting.
2013-08-22 05:06:04 19416 [Note] InnoDB: Starting shutdown...
2013-08-22 05:06:05 19416 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK


Filling help tables...2013-08-22 05:06:05 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-08-22 05:06:05 19439 [Note] InnoDB: The InnoDB memory heap is disabled
2013-08-22 05:06:05 19439 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-08-22 05:06:05 19439 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-08-22 05:06:05 19439 [Note] InnoDB: Using CPU crc32 instructions
2013-08-22 05:06:05 19439 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-08-22 05:06:05 19439 [Note] InnoDB: Completed initialization of buffer pool
2013-08-22 05:06:05 19439 [Note] InnoDB: Highest supported file format is Barracuda.
2013-08-22 05:06:05 19439 [Note] InnoDB: 128 rollback segment(s) are active.
2013-08-22 05:06:05 19439 [Note] InnoDB: Waiting for purge to start
2013-08-22 05:06:05 19439 [Note] InnoDB: 5.6.13 started; log sequence number 1625977
2013-08-22 05:06:05 19439 [Note] Binlog end
2013-08-22 05:06:05 19439 [Note] InnoDB: FTS optimize thread exiting.
2013-08-22 05:06:05 19439 [Note] InnoDB: Starting shutdown...
2013-08-22 05:06:06 19439 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK


To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:


  /usr/local/mysql56/bin/mysqladmin -u root password 'new-password'
  /usr/local/mysql56/bin/mysqladmin -u root -h 472322.ea.com password 'new-password'


Alternatively you can run:


  /usr/local/mysql56/bin/mysql_secure_installation


which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:


  cd . ; /usr/local/mysql56/bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl


  cd mysql-test ; perl mysql-test-run.pl


Please report any problems with the ./bin/mysqlbug script!


The latest information about MySQL is available on the web at


  http://www.mysql.com


Support MySQL by buying support/licenses at http://shop.mysql.com


New default config file was created as /usr/local/mysql56/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings


WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

感到信息有warning,那就重新再执行一遍,原来在做5.6.10安装测试的时候,init db不管第一次执行失败或者成功,都可以再执行第二遍的。
[root@472322 mysql56]# 
[root@472322 mysql56]# ll etc/my56.cnf
ls: cannot access etc/my56.cnf: No such file or directory
[root@472322 mysql56]# ll /etc/my56.cnf
-rw-r--r-- 1 root root 1126 Aug 22 05:05 /etc/my56.cnf
[root@472322 mysql56]# scripts/mysql_install_db  --user=mysql --basedir=/usr/local/mysql56 --datadir=/data56 --defaults-file=/etc/my56.cnf
Installing MySQL system tables...2013-08-22 05:07:31 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-08-22 05:07:31 19481 [Note] InnoDB: The InnoDB memory heap is disabled
2013-08-22 05:07:31 19481 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-08-22 05:07:31 19481 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-08-22 05:07:31 19481 [Note] InnoDB: Using CPU crc32 instructions
2013-08-22 05:07:31 19481 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-08-22 05:07:31 19481 [Note] InnoDB: Completed initialization of buffer pool
2013-08-22 05:07:31 19481 [Note] InnoDB: Highest supported file format is Barracuda.
2013-08-22 05:07:31 19481 [Note] InnoDB: 128 rollback segment(s) are active.
2013-08-22 05:07:31 19481 [Note] InnoDB: Waiting for purge to start
2013-08-22 05:07:31 19481 [Note] InnoDB: 5.6.13 started; log sequence number 1625987
2013-08-22 05:07:31 19481 [Note] Binlog end
2013-08-22 05:07:31 19481 [Note] InnoDB: FTS optimize thread exiting.
2013-08-22 05:07:31 19481 [Note] InnoDB: Starting shutdown...
2013-08-22 05:07:32 19481 [Note] InnoDB: Shutdown completed; log sequence number 1625997
OK


Filling help tables...2013-08-22 05:07:32 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-08-22 05:07:32 19505 [Note] InnoDB: The InnoDB memory heap is disabled
2013-08-22 05:07:32 19505 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-08-22 05:07:32 19505 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-08-22 05:07:32 19505 [Note] InnoDB: Using CPU crc32 instructions
2013-08-22 05:07:32 19505 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-08-22 05:07:32 19505 [Note] InnoDB: Completed initialization of buffer pool
2013-08-22 05:07:32 19505 [Note] InnoDB: Highest supported file format is Barracuda.
2013-08-22 05:07:32 19505 [Note] InnoDB: 128 rollback segment(s) are active.
2013-08-22 05:07:32 19505 [Note] InnoDB: Waiting for purge to start
2013-08-22 05:07:32 19505 [Note] InnoDB: 5.6.13 started; log sequence number 1625997
2013-08-22 05:07:32 19505 [Note] Binlog end
2013-08-22 05:07:32 19505 [Note] InnoDB: FTS optimize thread exiting.
2013-08-22 05:07:32 19505 [Note] InnoDB: Starting shutdown...
2013-08-22 05:07:34 19505 [Note] InnoDB: Shutdown completed; log sequence number 1626007
OK


To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:


  /usr/local/mysql56/bin/mysqladmin -u root password 'new-password'
  /usr/local/mysql56/bin/mysqladmin -u root -h 472322.ea.com password 'new-password'


Alternatively you can run:


  /usr/local/mysql56/bin/mysql_secure_installation


which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:


  cd . ; /usr/local/mysql56/bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl


  cd mysql-test ; perl mysql-test-run.pl


Please report any problems with the ./bin/mysqlbug script!


The latest information about MySQL is available on the web at


  http://www.mysql.com


Support MySQL by buying support/licenses at http://shop.mysql.com


WARNING: Found existing config file /usr/local/mysql56/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/mysql56/my-new.cnf,
please compare it with your file and take the changes you need.


WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server






10 copy start command 


cp support-files/mysql.server /etc/init.d/mysqld56
chmod 700 /etc/init.d/mysqld56
echo "export PATH=$PATH:/usr/local/mysql56/bin">>/etc/profile 
source /etc/profile


11 add command to system parameter
cd /data56
chkconfig --add mysqld56


12  start service & check & login
service mysqld56 start


[root@472322 data56]# service mysqld56 start
Starting MySQL. SUCCESS! 
[root@472322 data56]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.13 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> 

总结疑问:对linux底层不太熟悉,难道是因为前面没有事先安装好各种包而cmake出来错误的东西导致后面继续cmake就一直报错吗? 是否是需要准备好各种lib包然后才能yum install cmake呢?然后再安装mysql才能不报错呢?


欢迎熟悉linux底层的朋友或者有过这方面的经历的朋友给出宝贵的意见。



           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
这里写图片描述
你好! 这是你第一次使用 **Markdown编辑器** 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。

新的改变

我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:

  1. 全新的界面设计 ,将会带来全新的写作体验;
  2. 在创作中心设置你喜爱的代码高亮样式,Markdown 将代码片显示选择的高亮样式 进行展示;
  3. 增加了 图片拖拽 功能,你可以将本地的图片直接拖拽到编辑区域直接展示;
  4. 全新的 KaTeX数学公式 语法;
  5. 增加了支持甘特图的mermaid语法1 功能;
  6. 增加了 多屏幕编辑 Markdown文章功能;
  7. 增加了 焦点写作模式、预览模式、简洁写作模式、左右区域同步滚轮设置 等功能,功能按钮位于编辑区域与预览区域中间;
  8. 增加了 检查列表 功能。

功能快捷键

撤销:Ctrl/Command + Z
重做:Ctrl/Command + Y
加粗:Ctrl/Command + B
斜体:Ctrl/Command + I
标题:Ctrl/Command + Shift + H
无序列表:Ctrl/Command + Shift + U
有序列表:Ctrl/Command + Shift + O
检查列表:Ctrl/Command + Shift + C
插入代码:Ctrl/Command + Shift + K
插入链接:Ctrl/Command + Shift + L
插入图片:Ctrl/Command + Shift + G

合理的创建标题,有助于目录的生成

直接输入1次#,并按下space后,将生成1级标题。
输入2次#,并按下space后,将生成2级标题。
以此类推,我们支持6级标题。有助于使用TOC语法后生成一个完美的目录。

如何改变文本的样式

强调文本 强调文本

加粗文本 加粗文本

标记文本

删除文本

引用文本

H2O is是液体。

210 运算结果是 1024.

插入链接与图片

链接: link.

图片: Alt

带尺寸的图片: Alt

当然,我们为了让用户更加便捷,我们增加了图片拖拽功能。

如何插入一段漂亮的代码片

博客设置页面,选择一款你喜欢的代码片高亮样式,下面展示同样高亮的 代码片.

// An highlighted block var foo = 'bar'; 

生成一个适合你的列表

  • 项目
    • 项目
      • 项目
  1. 项目1
  2. 项目2
  3. 项目3
  • 计划任务
  • 完成任务

创建一个表格

一个简单的表格是这么创建的:

项目Value
电脑$1600
手机$12
导管$1

设定内容居中、居左、居右

使用:---------:居中
使用:----------居左
使用----------:居右

第一列第二列第三列
第一列文本居中第二列文本居右第三列文本居左

SmartyPants

SmartyPants将ASCII标点字符转换为“智能”印刷标点HTML实体。例如:

TYPEASCIIHTML
Single backticks'Isn't this fun?'‘Isn’t this fun?’
Quotes"Isn't this fun?"“Isn’t this fun?”
Dashes-- is en-dash, --- is em-dash– is en-dash, — is em-dash

创建一个自定义列表

Markdown
Text-to- HTML conversion tool
Authors
John
Luke

如何创建一个注脚

一个具有注脚的文本。2

注释也是必不可少的

Markdown将文本转换为 HTML

KaTeX数学公式

您可以使用渲染LaTeX数学表达式 KaTeX:

Gamma公式展示 Γ ( n ) = ( n − 1 ) ! ∀ n ∈ N \Gamma(n) = (n-1)!\quad\forall n\in\mathbb N Γ(n)=(n1)!nN 是通过欧拉积分

Γ ( z ) = ∫ 0 ∞ t z − 1 e − t d t   . \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,. Γ(z)=0tz1etdt.

你可以找到更多关于的信息 LaTeX 数学表达式here.

新的甘特图功能,丰富你的文章

gantt
        dateFormat  YYYY-MM-DD
        title Adding GANTT diagram functionality to mermaid
        section 现有任务
        已完成               :done,    des1, 2014-01-06,2014-01-08
        进行中               :active,  des2, 2014-01-09, 3d
        计划一               :         des3, after des2, 5d
        计划二               :         des4, after des3, 5d
  • 关于 甘特图 语法,参考 这儿,

UML 图表

可以使用UML图表进行渲染。 Mermaid. 例如下面产生的一个序列图::

张三 李四 王五 你好!李四, 最近怎么样? 你最近怎么样,王五? 我很好,谢谢! 我很好,谢谢! 李四想了很长时间, 文字太长了 不适合放在一行. 打量着王五... 很好... 王五, 你怎么样? 张三 李四 王五

这将产生一个流程图。:

链接
长方形
圆角长方形
菱形
  • 关于 Mermaid 语法,参考 这儿,

FLowchart流程图

我们依旧会支持flowchart的流程图:

  • 关于 Flowchart流程图 语法,参考 这儿.

导出与导入

导出

如果你想尝试使用此编辑器, 你可以在此篇文章任意编辑。当你完成了一篇文章的写作, 在上方工具栏找到 文章导出 ,生成一个.md文件或者.html文件进行本地保存。

导入

如果你想加载一篇你写过的.md文件或者.html文件,在上方工具栏可以选择导入功能进行对应扩展名的文件导入,
继续你的创作。


  1. mermaid语法说明 ↩︎

  2. 注脚的解释 ↩︎

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值