• MYSQL数据库的安装


    安装MySQL

    下载的mysql的安装包就是MySQL-5.6.22-1.el6.x86_64.rpm-bundle.tar。可以使用file命令来查看一下这个文件,它是一个tar的软件包,所以说我们需要先将这个tar包解开,再运行里面的rpm包,
    [root@robin tmp]# file MySQL-5.6.22-1.el6.x86_64.rpm-bundle.tar
    MySQL-5.6.22-1.el6.x86_64.rpm-bundle.tar: POSIX tar archive (GNU)

    [root@robin tmp]# tar xf MySQL-5.6.22-1.el6.x86_64.rpm-bundle.tar

    [root@robin tmp]# ls /tmp/
    MySQL-client-5.6.22-1.el6.x86_64.rpm
    MySQL-devel-5.6.22-1.el6.x86_64.rpm
    MySQL-embedded-5.6.22-1.el6.x86_64.rpm
    MySQL-server-5.6.22-1.el6.x86_64.rpm
    MySQL-shared-5.6.22-1.el6.x86_64.rpm
    MySQL-shared-compat-5.6.22-1.el6.x86_64.rpm
    MySQL-test-5.6.22-1.el6.x86_64.rpm

    可以看到得到了很多的rpm包,这里面常用的包有MySQL-client-5.6.22-1.el6.x86_64.rpm和mMySQL-server-5.6.22-1.el6.x86_64.rpm,如果仅仅是想安装一个MySQL的服务器使用的话,安装这两个包其实就足够了,它包含了mysql的服务器端和客户端软件。有些时候还需要MySQL-devel软件包,这个包也常安装,它里面包含了MySQL的库文件以及头文件,有些时候安装一些其他的软件需要调用到这些MySQL的库文件和头文件的时候就安装MySQL-devel包,比方说安装MySQL proxy代理服务器,或者是mysql enterprise monitor监控软件可能都需要安装mysql-devel软件包,下面来安装这些软件包。安装方式可以采用两种:

    一种是rpm命令一个个安装,在安装过程中可能会遇到依赖性问题,需要手工去解决。
    [root@robin tmp]# rpm -ivh MySQL-client-5.6.22-1.el6.x86_64.rpm
    Preparing... ########################################### [100%]
    1:MySQL-client ########################################### [100%]


    另外一个方式是使用yum命令的方式。
    [root@node1 tmp]# yum install MySQL-server-5.6.22-1.el6.x86_64.rpm


    安装完毕之后,屏幕上打印出了很多的内容,注意下面这句话:


    A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
    You will find that password in '/root/.mysql_secret'.


    一个随机性的密码已经为mysql的root 用户设置好了,你可以在root家目录下的.msyql_secret中看到这个密码,这个是mysql 5.5版本之后新出现的一个特性,mysql 5.5之前的版本在安装完之后,有一个非常重要的安全性隐患就是mysql 管理用户和mysql root用户是空密码,所以对于一个刚刚安装完成之后的mysql服务器来说,任何人可以从任何地方使用空密码直接访问数据库,这是一个很不安全的事情,因此在5.5.以后在mysql安装完之后会随机性的为root用户随机设置一个密码并且把它保存在root家目录下的.msyql_secret文件中

    You must change that password on your first connect,
    no other statement but 'SET PASSWORD' will be accepted.
    See the manual for the semantics of the 'password expired' flag.


    你必须在你第一次连接mysql的时候重设这个密码。别的都干不了,但是'SET PASSWORD这个命令是可以执行的,可以去看相应的手册,比如 password expired部分的介绍

    Also, the account for the anonymous user has been removed.

    In addition, you can run:

    /usr/bin/mysql_secure_installation

    which will also give you the option of removing the test database.
    This is strongly recommended for production servers.

    See the manual for more instructions.


    这里提到了一个工具叫做mysql_secure_installation叫安全的安装,这个安装其实提供了几个功能,让我们在初次安装MySQL之后呢,提供一些安装上面的修改,建议大家在安装完毕之后使用,后面还有一些介绍,可以去mysql官方网站去看它的手册,还可以去shop.mysql.com买它的商品,等等。


    Please report any problems at http://bugs.mysql.com/

    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/my.cnf and
    will be used by default by the server when you start it.
    You may edit this file to change server settings


    首先想要去操作mysql的时候,需要知道它给我们设置的随机密码是什么。我们来看一下
    [root@robin tmp]# cd

    [root@robin ~]# ls .mysql_secret
    .mysql_secret

    [root@robin ~]# cat .mysql_secret
    # The random password set for the root user at Mon Dec 8 01:47:25 2014 (local time): T9YV_AZe_HIZoQ5z

    .mysql_secret这个文件里面写了随机性的密码。要连接mysql,就需要把这些随机密码输入进去。

    不过先不着急,先运行一下mysql_secure_installation这个命令,建议在第一次安装完成之后先运行这个命令,如果你没有运行mysql的话,当然无法对它进行一些安装方面的设置和操作。先把mysql这个服务启动起来。


    [root@robin ~]# service mysql start
    Starting MySQL. [ OK ]

    这里介绍一下,在mysql5.1版本之后,官方所发布的mysql的安装包服务名称就发生了变化,以前叫做mysqld,现在叫做mysql。另外需要注意一点的是,rhel发行版本的光盘中带的mysql它的服务名称仍然是mysqld,所以这个名字不要忘记,官方下的这个MySQL包叫做mysql,如果redhat发行的光盘当中叫做mysqld,我们可以使用service mysqld start 来启动mysql,或者也可以使用 /etc/init.d/mysqld start 通过脚本启动它。这两条命令作用是一样的。

    现在再来执行mysql_secure_installation,接下来输入.mysql_secret中的密码。输入密码之后它会问是否修改密码,可以将密码修改为一个容易记忆的,符合密码复杂性要求的密码,比方说至少八位以上数字大小写字母特殊符号都有等等的要求。

    [root@robin ~]# mysql_secure_installation

    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
    SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

    In order to log into MySQL to secure it, we'll need the current
    password for the root user. If you've just installed MySQL, and
    you haven't set the root password yet, the password will be blank,
    so you should just press enter here.

    Enter current password for root (enter for none):
    OK, successfully used password, moving on...

    Setting the root password ensures that nobody can log into the MySQL
    root user without the proper authorisation.

    You already have a root password set, so you can safely answer 'n'.

    Change the root password? [Y/n] y
    New password:
    Re-enter new password:
    Password updated successfully!
    Reloading privilege tables..
    ... Success!

    接下来它继续问你,mysql在安装完毕之后,它默认会创建一个匿名用户,这个匿名用户是用来进行mysql测试时使用的,这个匿名用户它允许任何人从任何地方登陆到mysql,但是不能干其他的一些事情,这个也是一个安全隐患,所以它会问你是否要移出匿名用户,选择yes移除,


    By default, a MySQL installation has an anonymous user, allowing anyone
    to log into MySQL without having to have a user account created for
    them. This is intended only for testing, and to make the installation
    go a bit smoother. You should remove them before moving into a
    production environment.

    Remove anonymous users? [Y/n] y
    ... Success!

    接下来,root是只允许从本地登录mysql的,所以在这里它给你提供了一个选项,是否禁止root用户从远程的机器上登录到这台mysql,这个设置一般来说在生产环境当中应该选择的是yes,也就是关闭。因为在生产环境当中往往注重mysql的安全性,所以对于mysql管理用户的登录是限制的非常严格的,如果你需要用root用户来登录mysql的话,往往先是ssh远程连接的方式,先登录到具体的服务器上,然后在这台服务器的本地使用root用户来登录。当然对于其它一些要求不严格的情况下,是允许root用户远程登录的,所以说这个选项是否选择,要看具体公司的安全要求,来针对性选择。这里选择n,允许root用户远程登录。

    Normally, root should only be allowed to connect from 'localhost'. This
    ensures that someone cannot guess at the root password from the network.

    Disallow root login remotely? [Y/n] n
    ... Success!


    接下来,默认情况下mysql在安装的时候会创建一个叫做test的库,这个库任何人都可以进行访问,这个库的用途是用于测试的,所以说问你是否要移除test数据库,y移除

    By default, MySQL comes with a database named 'test' that anyone can
    access. This is also intended only for testing, and should be removed
    before moving into a production environment.

    Remove test database and access to it? [Y/n] y
    - Dropping test database...
    ... Success!
    - Removing privileges on test database...
    ... Success!

    接下来是否重读一下授权表,这样可以对mysql相应的授权,刚才所发生的一些修改,保证它立即生效,yes。这样一来的可以安全放心的使用mysql了。

    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.

    Reload privilege tables now? [Y/n] y
    ... Success!


    All done! If you've completed all of the above steps, your MySQL
    installation should now be secure.

    Thanks for using MySQL!


    Cleaning up...

    接下来介绍mysql客户端的一些使用,客户端的使用分为两种:

    客户端使用
    · 交互式
    · 非交互式

    最为常用的往往是交互式,而非交互式往往在某一些特殊需要下才进行使用。


    首先来看,最为基本的客户端就是mysql这个命令了。

    范例一:mysql -h 192.168.0.1 -P 3306 -uroot -p123 [dbname]
    范例二:mysql -e “create database power”

    mysql命令后面可以跟上很多相应的参数,不同的参数起到不同的作用,看一下这些参数的使用。

    常见参数 解释
    ----------------------------------
    -u 指定登录用户名
    -p 指定登录密码
    -h 指定数据库主机地址
    -P 指定登录端口
    dbname 指定操作数据库
    -e 使用非交互式操作


    -P 指定登录msyql服务器的端口,默认端口是3306,如果在设置服务器的时候将服务器的端口改成别的了,在这里可以指定别的端口号,比方说3300。
    -p 如果为-u指定的用户设置了密码,那么-p就必须指定,如果没有为用户设置密码,这个用户是空密码,一般来说是不会这么做的,假设说没有密码,不指定-p 也可以,直接就可以登录。

    注意-p之后如果要写密码的话,一定要紧跟着-p之后写密码-ppasswd,一旦-p后面发生了空格的话,它就会认为这个密码,并不像在命令行当中输入,而是在enter之后提供给一个密码提示符后面输入密码进行登录,而空格之后的字符,它就会认为是要操作的数据库的名称,因此有没有空格区别很大,这一点一定要注意,前面这些参数可以没有空格,前面的参数是无所谓的,有没有空格都可以,但是一定要注意到特别是这个-p,-p后面的空格就变得非常敏感了,所以一般来说将-p参数放到最后来写。方便写完密码之后,写数据库。


    [root@robin ~]# mysql -h localhost -u root -p123
    Warning: Using a password on the command line interface can be insecure.
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 25
    Server version: 5.6.22 MySQL Community Server (GPL)

    Copyright (c) 2000, 2014, 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>

    现在要登录到本机的数据库上,假如说直接使用数据库的管理员用户root用户,其实这样一来参数就会大大的简化,因为一些可选性的参数就可以不写了,可以直接写mysql -p就可以了,-h不写默认就是本机,所以说可以省略的,-u参数不写默认使用root用户登录,也可省略,-P不写默认使用端口3306,数据库端口没有改过,默认就是3306,所以说这个也可以不写,-p一定要写,因为给root用户设置过密码,数据库名称也可以不写,可以进入数据库之后再去指定,所以最简化的方式就是mysql -p,-p后面也不跟密码直接enter,会看到在下一行当中它会提示你输入密码,可以再这里输入密码,而且在这里输入密码还有一个好处,密码并不会直接显示在终端上。这样更加安全一些。enter之后你会看到mysql的欢迎信息,并且提示符会变成mysql跟着一个>大于符号,这就代表登录成功了,就连接到了mysql的数据库里面。

    [root@robin ~]# mysql -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 26
    Server version: 5.6.22 MySQL Community Server (GPL)

    Copyright (c) 2000, 2014, 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>

    基本语句操作
    mysql> create database db;
    mysql> use db;
    mysql> create table test(id int,name char(10));
    mysql> desc test;
    mysql> insert into test values(1,"robin");
    mysql> select * from test;
    mysql> drop table test;
    mysql> drop database db;


    ============================================================================================================

    编译安装MySQL


    MySQL自5.5版本以后,就开始使用CMake编译工具了,因此,在安装源文件中找不到configure文件是正常的。


    [root@robin tmp]# tar xf cmake-3.1.0-rc2.tar.gz
    [root@robin tmp]# cd cmake-3.1.0-rc2
    [root@robin cmake-3.1.0-rc2]# ./configure
    [root@robin cmake-3.1.0-rc2]# gmake
    [root@robin cmake-3.1.0-rc2]# make install


    下表列出了常用编译工具的调用语法和等效的CMake命令。“.”表示当前的工作目录路径,请根据所在的目录,适当的替换掉路径“.”。
    configure命令 CMake命令
    -------------------------------------------------------
    ./configure cmake .
    ./configure --help cmake . -LH or ccmake .


    在重新配置或重新构建之前,需要先清除旧的对象文件和缓存信息:

    make clean
    rm CMakeCache.txt

    安装参数选项

    在下表中,“CMAKE_INSTALL_PREFIX”的值表示的是安装根目录,其他参数值的路径都是相对于根目录的,当然也可以直接使用绝对路径:
    参数值说明 配置选项 CMak选项
    -------------------------------------------------------------------------------------------------------------------
    安装根目录 --prefix=/usr -DCMAKE_INSTALL_PREFIX=/usr
    mysqld目录 --libexecdir=/usr/sbin -DINSTALL_SBINDIR=sbin
    数据存储目录 --localstatedir=/var/lib/mysql -DMYSQL_DATADIR=/var/lib/mysql
    配置文件(my.cnf)目录 --sysconfdir=/etc/mysql -DSYSCONFDIR=/etc/mysql
    插件目录 --with-plugindir=/usr/lib64/mysql/plugin -DINSTALL_PLUGINDIR=lib64/mysql/plugin
    手册文件目录 --mandir=/usr/share/man -DINSTALL_MANDIR=share/man
    共享数据目录 --sharedstatedir=/usr/share/mysql -DINSTALL_SHAREDIR=share
    Library库目录 --libdir=/usr/lib64/mysql -DINSTALL_LIBDIR=lib64/mysql
    Header安装目录 --includedir=/usr/include/mysql -DINSTALL_INCLUDEDIR=include/mysql
    信息文档目录 --infodir=/usr/share/info -DINSTALL_INFODIR=share/info

    存储引擎选项

    存储引擎是以插件的形式存在的,所以,该选项可以控制插件的构建,比如指定使用某个特定的引擎。

    --with-plugins配置选项接受两种形式的参数值,它没有对应的CMake配置参数:

    ① 以逗号(,)分隔的引擎名称列表;

    ② a "group name" value that is shorthand for a set of engines

    在CMake中,引擎被作为单个的选项来进行控制。假设有以下配置选项:


    --with-plugins=csv,myisam,myisammrg,heap,innobase,archive,blackhole

    上面的参数指定MySQL数据库可以支持哪些数据库引擎,将上述编译选项转换成CMake编译选项时,下面的几个引擎名字可以被省略,因为编译时,默认就支持:

    csv myisam myisammrg heap

    然后使用下面的编译参数,以启用InnoDB、ARCHIVE和BLACKHOLE引擎支持:

    -DWITH_INNOBASE_STORAGE_ENGINE=1
    -DWITH_ARCHIVE_STORAGE_ENGINE=1
    -DWITH_BLACKHOLE_STORAGE_ENGINE=1

    当然也可以使用“ON”来替代数字1,它们是等效的。

    如果想除去对某种引擎的支持,则在CMake编译选项中使用-DWITHOUT_<ENGINE>_STORAGE_ENGINE,例如:

    -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
    -DWITHOUT_FEDERATED_STORAGE_ENGINE=1
    -DWITHOUT_PARTITION_STORAGE_ENGINE=1

    库文件加载选项

    该选项指明Mysql使用库的情况:

    参数值说明 配置选项 CMake选项
    -------------------------------------------------------------------------
    readline库 --with-readline -DWITH_READLINE=1
    SSL库 --with-ssl=/usr -DWITH_SSL=system
    zlib库 --with-zlib-dir=/usr -DWITH_ZLIB=system
    libwrap库 --without-libwrap -DWITH_LIBWRAP=0


    其他选项

    CMake编译选项支持大部分之前版本的MySQL编译选项,新老编译选项的差别在于:之前的是小写,现在全部变成了大写,之前采用双横线,现在使用单横线,之前使用的破折号,现在取而代之的是使用下划线,例如:

    --with-debug => WITH_DEBUG=1
    --with-embedded-server => WITH_EMBEDDED_SERVER

    下面是编译MySQL的新老参数对照表:

    参数值说明 配置选项 CMak选项
    --------------------------------------------------------------------------------------------------------------
    TCP/IP端口 --with-tcp-port-=3306 -DMYSQL_TCP_PORT=3306
    UNIX socket文件 --with-unix-socket-path=/tmp/mysqld.sock -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock
    启用加载本地数据 --enable-local-infile -DENABLED_LOCAL_INFILE=1
    扩展字符支持 --with-extra-charsets=all(默认:all) -DEXTRA_CHARSETS=all(默认:all)
    默认字符集 --with-charset=utf8 -DDEFAULT_CHARSET=utf8
    默认字符校对 --with-collation=utf8_general_ci -DDEFAULT_COLLATION=utf8_general_ci
    Build the server --with-server 无
    嵌入式服务器 --with-embedded-server -DWITH_EMBEDDED_SERVER=1
    libmysqld权限控制 --with-embedded-privilege-control 无
    安装文档 --without-docs 无
    Big tables支持 --with-big-tables, --without-big-tables 无
    mysqld运行用户 --with-mysqld-user=mysql -DMYSQL_USER=mysql
    调试模式 --without-debug(默认禁用) -DWITH_DEBUG=0(默认禁用)
    GIS支持 --with-geometry 无
    社区功能 --enable-community-features 无
    Profiling --disable-profiling(默认启用) -DENABLE_PROFILING=0(默认启用)
    pstack --without-pstack 无(新版移除该功能)
    汇编字符串函数 --enable-assembler 无
    构建类型 --build=x86_64-pc-linux-gnu 没有等效参数
    交叉编译主机 --host=x86_64-pc-linux-gnu 没有等效参数
    客户端标志 --with-client-ldflags=-lstdc++ 无
    线程安全标志 --enable-thread-safe-client 无
    注释存储类型 --with-comment='string' -DWITH_COMMENT='string'
    Shared/static binaries --enable-shared --enable-static 无
    内存使用控制 --with-low-memory 无

    [root@robin mysql-5.6.22]# cmake
    > -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
    > -DMYSQL_DATADIR=/usr/local/mysql/data
    > -DSYSCONFDIR=/etc
    > -DWITH_READLINE=1
    > -DMYSQL_TCP_PORT=3306
    > -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock
    > -DENABLED_LOCAL_INFILE=1
    > -DEXTRA_CHARSETS=all
    > -DDEFAULT_CHARSET=utf8
    > -DDEFAULT_COLLATION=utf8_general_ci


    [root@robin mysql-5.6.22]# make
    [root@robin mysql-5.6.22]# make install


    [root@robin mysql-5.6.22]# cd /usr/local/mysql/
    [root@robin mysql]# useradd -M -u 27 -s /sbin/nologin mysql
    [root@robin mysql]# ./scripts/mysql_install_db --user=mysql


    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:

    ./bin/mysqladmin -u root password 'new-password'
    ./bin/mysqladmin -u root -h robin.power.com password 'new-password'

    Alternatively you can run:

    ./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 . ; ./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 at http://bugs.mysql.com/

    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 ./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

    安装成功后,启动源码mysql
    1.初始化数据库
    如果没有mysql用户,则先添加用户
    [root@www mysql]# useradd -s /sbin/nologin mysql
    [root@www mysql]# cd /usr/local/mysql/
    [root@www mysql]# ./scripts/mysql_install_db --user=mysql
    [root@www mysql]# chown -R mysql.mysql /usr/local/mysql/


    2.启动mysql
    [root@www mysql]# /usr/local/mysql/bin/mysqld_safe --user=mysql &
    [root@www mysql]# netstat -anplt | grep :3306
    tcp 0 0 :::3306 :::* LISTEN 30051/mysqld

    3.设置密码
    [root@www mysql]# /usr/local/mysql/bin/mysqladmin -u root password '123'

    4.设置mysql的安全
    [root@www mysql]# /usr/local/mysql/bin/mysql_secure_installation

    5.登录测试:
    [root@www mysql]# /usr/local/mysql/bin/mysql -u root -p123


    总结:
    rpm包mysql:
    数据文件:/var/lib/mysql
    日志文件:/var/lib/mysql/{主机名}.err
    启动服务:/etc/init.d/mysql restart
    [root@www mysql]# /usr/bin/mysqld_safe --user=mysql &
    socket文件:/var/lib/mysql/mysql.sock
    客户端:/usr/bin/mysql
    关于mysql命令:/usr/bin/mysql*

    源码包mysql:
    数据文件:/usr/local/mysql/data
    日志文件:/usr/local/mysql/data/{主机名}.err
    启动服务:/usr/local/mysql/bin/mysqld_safe --user=mysql &
    socket文件:/tmp/mysql.sock
    客户端:/usr/local/mysql/bin/mysql
    mysql命令:/usr/local/mysql/bin


    源码包通过脚本启动:
    [root@www support-files]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

    [root@www support-files]# service mysqld restart

    开机自启动:
    [root@www ~]# chkconfig --add mysqld
    [root@www ~]# chkconfig mysqld on
    [root@www ~]# chkconfig --list mysqld
    mysqld 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

    客户端:
    [root@www ~]# vim /etc/bashrc 或者 /etc/profile
    PATH=/usr/local/mysql/bin:$PATH
    export PATH

    [root@www mysql]# source /etc/profile


    [root@robin mysql]# chown -R root.mysql /usr/local/mysql/
    [root@robin mysql]# chown -R mysql data
    [root@robin mysql]# vim /etc/profile
    export PATH=$PATH:/usr/local/mysql/bin
    [root@robin mysql]# source /etc/profile

    [root@robin mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
    [root@robin mysql]# chmod +x /etc/init.d/mysqld

    [root@robin mysql]# chkconfig --add mysqld
    [root@robin mysql]# chkconfig --list mysqld
    mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    [root@robin mysql]# service mysqld start
    Starting MySQL.. [ OK ]
    [root@robin mysql]# netstat -tunpl | grep 3306
    tcp 0 0 :::3306 :::* LISTEN 30509/mysqld


    [root@robin mysql]# mysql -uroot
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1
    Server version: 5.6.22 Source distribution

    Copyright (c) 2000, 2014, 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>

  • 相关阅读:
    性能测试
    Oracle Install logs
    运维服务方案
    对字符串的查找,剪切,替换,提取(正则表达式)
    用java程序模拟网站的登录以及文件批量上传
    HDU_1542_(树状数组)
    HDU_3792_(素数筛+树状数组)
    Codeforces_791_B. Bear and Friendship Condition_(dfs)
    POJ_1125_(dijkstra)
    POJ_1088_(dp)(记忆化搜索)
  • 原文地址:https://www.cnblogs.com/yangxiaochu/p/6780060.html
Copyright © 2020-2023  润新知