Skip to content

Instantly share code, notes, and snippets.

@winse
Created February 6, 2014 09:03
Show Gist options
  • Save winse/8840729 to your computer and use it in GitHub Desktop.
Save winse/8840729 to your computer and use it in GitHub Desktop.
简书Markdown

一些使用注意点:

  • 由于简书使用GFW的拓展版的Markdown;
    • 内容换行被解析为
      ,2+个换行才被解析为

    • 代码块使用```
    • 链接URL。
  • 4个空格相当于一个Tab;
  • 嵌套元素:关于空格的使用各个解析器好像都不同,有些严格遵循规范,在简书中,直接使用一个空格也行。多个换行会被解析为新元素。

1. 标题

一级标题

二级标题

...

六级标题

16个#分别表示网页中h1h6的标题。

2. 段落

这是一个段落。 这是一个段落。

3. 字体

加粗 斜体 斜体加粗 中划线

也可以使用下划线_代替*

4. 列表

  • 项1
  • 项2
  • 项3
  • 项4

5. 链接

http://github.com winse http://plasticboy.com/markdown-vim-mode G <-- 后面没有内容时需要加G Google

6. 图片

winse

7. 引用/源代码

引用

源代码

8. 分隔符




9. 表格

Name Description
Help Display the help window.
Close Closes a window
使用` `分隔各个单元格的内容。

** 内容对齐 **

Left-Aligned Center Aligned Right Aligned
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1

使用冒号:来标识对齐的方式。

参考

@anter2017999
Copy link

CentOS 6.5 源码安装MySQL5.1.73
https://my.oschina.net/goopand/blog/343972

一、安装前检查,确保开发工具包都已安装

yum grouplist | grep Devel

yum groupinstall "Development tools" -y

rpm -qa | grep -i libtool

yum -y install libtool

对于有些需要从光盘安装的,需挂载iso镜像:

(对于Virtualbox虚拟机,需要把iso文件加载到“存储”(第二IDE控制器主通道),然后执行#mount /dev/cdrom /mnt/iso即可)

二、创建mysql用户、组

groupadd mysql

useradd -g mysql -s /bin/bash -M -d /home/mysql mysql

mkdir -p /usr/local/mysql

mkdir -p /usr/local/mysql/data

三、解压安装包

cp mysql-5.1.73.tar.gz /tmp

cd /tmp

tar -zxvf mysql-5.1.73.tar.gz

四、预编译配置

cd mysql-5.1.73

./configure \

--prefix=/usr/local/mysql
--localstatedir=/usr/local/mysql/data
--sysconfdir=/etc/mysql/
--with-unix-socket-path=/usr/local/mysql/sock/mysql.sock
--enable-assembler
--enable-profiling
--enable-thread-safe-client
--with-mysqld-user=mysql
--with-tcp-port=3306
--with-big-tables
--without-debug
--with-extra-charsets=utf8,gbk
--with-charset=utf8
--with-collation=utf8_general_ci
--with-embedded-server
--enable-local-infile
--with-plugins=innobase,myisam
--with-server-suffix=-community
--with-mysqld-ldflags=-all-static
--with-client-ldflags=-all-static
[注意]:可能会出现"/bin/rm: cannot remove `libtoolT': No such file or directory"这样的报错。

其中一种解决办法是:# vi configure ,把$RM "$cfgfile" 这一行改成:$RM -f "$cfgfile",保存退出,重新执行。

五、编译安装(make && make install)

make && make install

cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

注:配置文件,有large,medium,small三个环境下的,根据机器性能选择,如果负荷比较大,可修改里面的一些变量的内存使用值

/usr/local/mysql/bin/mysql_install_db --user=mysql

Installing MySQL system tables...
150205 2:22:30 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
150205 2:22:31 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
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/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h inspB password 'new-password'

Alternatively you can run:
/usr/local/mysql/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/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

chown -R mysql:mysql /usr/local/mysql/

六、添加服务

cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld

chmod 755 /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

chkconfig mysqld off

service mysqld start

或者

/usr/local/mysql/bin/mysqld_safe &

七、安装后检测并修改root密码

/usr/local/mysql/bin/mysqladmin version

/usr/local/mysql/bin/mysqladmin ping

ln -s /usr/local/mysql/bin/mysql /usr/bin/

ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/

设置root密码

mysqladmin -u root password "YourPassword"

配置mysql库文件搜索路径

echo "/usr/local/mysql/lib/mysql/" >>/etc/ld.so.conf

ldconfig -v

八、清除空密码数据库用户,增加外部连接用户

mysql -u root -p

mysql> grant all privileges on . to goopand@'%' identified by 'MyPassword';
mysql> flush privileges;
mysql> use mysql;
mysql> delete from user where password="";
mysql> exit;
说明:

grant <权限1>,<权限2>,...,<权限n> on <数据库名称>.<表名称> to <用户名>@<用户地址> identified by '<连接口令>';
放开防火墙对默认端口3306的限制

vi /etc/sysconfig/iptables , 添加一行:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

service iptables restart

@anter2017999
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment