linux学习之centos(三):mysql数据库的安装和配置
前言:mysql简介
说到数据库,我们大多想到的是关系型数据库,比如mysql、oracle、sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱不得不首先推荐的是mysql数据库了,而且Mysql数据库的第一个版本就是发行在Linux系统上的。
MySQL是一个关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司。MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性。MySQL的SQL语言是用于访问数据库的最常用标准化语言。MySQL软件采用了双授权政策(本词条“授权政策”),它分为社区版和商业版,由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,一般中小型网站的开发都选择MySQL作为网站数据库。由于其社区版的性能卓越,搭配PHP和Apache可组成良好的开发环境。
在Linux上安装mysql数据库,我们可以去其官网上下载mysql数据库的rpm包,http://dev.mysql.com/downloads/mysql/5.6.html#downloads,大家可以根据自己的操作系统去下载对应的数据库文件
--->本次是通过yum来进行mysql数据库的安装的,通过这种方式进行安装,可以将跟mysql相关的一些服务、jar包都给我们安装好,能省去很多不必要的麻烦!
一、卸载系统原有mysql
因为mysql数据库在Linux上实在是太流行了,所以目前下载的主流Linux系统版本基本上都集成了mysql数据库在里面
切换到root用户下操作:
[carsonzhu@localhost ~]$ su
查看该操作系统是否已经安装了mysql数据库:
[root@localhost carsonzhu]# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.x86_64
然后我用下面的方式试图删除mysql(遇到了问题):
[root@localhost carsonzhu]# rpm -e mysql-libs-5.1.71-1.el6.x86_64
error: Failed dependencies:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
[root@localhost carsonzhu]# rpm -e mysql-libs-5.1.71-1.el6.x86_64.rpm --nodeps
error: package mysql-libs-5.1.71-1.el6.x86_64.rpm is not installed
说是卸载的时候有依赖包,需要先把postfix-2:2.6.6-2.2.el6_1.x86_64卸载掉,rpm -e postfix-2:2.6.6-2.2.el6_1.x86_64也是不行!然后我搜索解决方法(CentOS 6.3 64位下彻底卸载mysql5.5.25图解教程)有:
如果存在CentOS自带mysql-libs-5.1.71-1.el6.x86_64使用下面的命令卸载即可
[root@localhost carsonzhu]# rpm -ev --nodeps mysql-libs-5.1.71-1.el6.x86_64
[root@localhost carsonzhu]# rpm -qa|grep -i mysql //查看mysql是否已经卸载成功
发现什么都没有了
[root@localhost carsonzhu]# find / -name mysql //查找之前老版本mysql的目录
发现也没有内容
(注:假设查找结果如下:
[root@localhost ~]# find / -name mysql
# /var/lib/mysql
# /var/lib/mysql/mysql
# /usr/lib64/mysql
删除对应的mysql目录
# rm -rf /var/lib/mysql
# rm -rf /var/lib/mysql
# rm -rf /usr/lib64/mysql
这里卸载后/etc/my.cnf不会删除,需要进行手工删除
# rm -rf /etc/my.cnf)
二、通过yum来安装mysql
查看yum上提供下载的mysql的版本信息:
[root@localhost carsonzhu]# yum list | grep mysql
apr-util-mysql.x86_64 1.3.9-3.el6_0.1 base
bacula-director-mysql.x86_64 5.0.0-13.el6 base
bacula-storage-mysql.x86_64 5.0.0-13.el6 base
dovecot-mysql.x86_64 1:2.0.9-19.el6_7.2 updates
freeradius-mysql.x86_64 2.2.6-6.el6_7 updates
libdbi-dbd-mysql.x86_64 0.8.3-5.1.el6 base
mod_auth_mysql.x86_64 1:3.0.0-11.el6_0.1 base
mysql.x86_64 5.1.73-5.el6_7.1 updates
mysql-bench.x86_64 5.1.73-5.el6_7.1 updates
mysql-connector-java.noarch 1:5.1.17-6.el6 base
mysql-connector-odbc.x86_64 5.1.5r1144-7.el6 base
mysql-devel.i686 5.1.73-5.el6_7.1 updates
mysql-devel.x86_64 5.1.73-5.el6_7.1 updates
mysql-embedded.i686 5.1.73-5.el6_7.1 updates
mysql-embedded.x86_64 5.1.73-5.el6_7.1 updates
mysql-embedded-devel.i686 5.1.73-5.el6_7.1 updates
mysql-embedded-devel.x86_64 5.1.73-5.el6_7.1 updates
mysql-libs.i686 5.1.73-5.el6_7.1 updates
mysql-libs.x86_64 5.1.73-5.el6_7.1 updates
mysql-server.x86_64 5.1.73-5.el6_7.1 updates
mysql-test.x86_64 5.1.73-5.el6_7.1 updates
php-mysql.x86_64 5.3.3-46.el6_7.1 updates
qt-mysql.i686 1:4.6.2-28.el6_5 base
qt-mysql.x86_64 1:4.6.2-28.el6_5 base
rsyslog-mysql.x86_64 5.8.10-10.el6_6 base
rsyslog7-mysql.x86_64 7.4.10-3.el6_7.1 updates
然后,可以通过输入 yum install -y mysql-server mysql mysql-devel 命令将mysql mysql-server mysql-devel都安装好(注:安装mysql时并不是安装了mysql客户端就相当于安装好了mysql数据库了,还需要安装mysql-server服务端才行)
等待一番时间后,yum会帮我们选择好安装mysql数据库所需要的软件以及其它附属的一些软件
[root@localhost carsonzhu]# yum install -y mysql-server mysql mysql-deve
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.zju.edu.cn
* extras: mirrors.skyshe.cn
* updates: mirrors.skyshe.cn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
No package mysql-deve available.
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.1.73-5.el6_7.1 will be installed
--> Processing Dependency: mysql-libs = 5.1.73-5.el6_7.1 for package: mysql-5.1.73-5.el6_7.1.x86_64
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-5.el6_7.1.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-5.el6_7.1.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-5.1.73-5.el6_7.1.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-5.1.73-5.el6_7.1.x86_64
---> Package mysql-server.x86_64 0:5.1.73-5.el6_7.1 will be installed
--> Processing Dependency: perl-DBI for package: mysql-server-5.1.73-5.el6_7.1.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-5.el6_7.1.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-server-5.1.73-5.el6_7.1.x86_64
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-5.el6_7.1 will be installed
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved ================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql x86_64 5.1.73-5.el6_7.1 updates 894 k
mysql-server x86_64 5.1.73-5.el6_7.1 updates 8.6 M
Installing for dependencies:
mysql-libs x86_64 5.1.73-5.el6_7.1 updates 1.2 M
perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k
perl-DBI x86_64 1.609-4.el6 base 705 k Transaction Summary
================================================================================
Install 5 Package(s) Total download size: 12 M
Installed size: 33 M
Downloading Packages:
(1/5): mysql-5.1.73-5.el6_7.1.x86_64.rpm | 894 kB 00:00
(2/5): mysql-libs-5.1.73-5.el6_7.1.x86_64.rpm | 1.2 MB 00:01
(3/5): mysql-server-5.1.73-5.el6_7.1.x86_64.rpm | 8.6 MB 00:08
(4/5): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm | 134 kB 00:00
(5/5): perl-DBI-1.609-4.el6.x86_64.rpm | 705 kB 00:00
--------------------------------------------------------------------------------
Total 1.0 MB/s | 12 MB 00:11
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)
2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of mysql-libs
Installing : mysql-libs-5.1.73-5.el6_7.1.x86_64 1/5
Installing : perl-DBI-1.609-4.el6.x86_64 2/5
Installing : perl-DBD-MySQL-4.013-3.el6.x86_64 3/5
Installing : mysql-5.1.73-5.el6_7.1.x86_64 4/5
Installing : mysql-server-5.1.73-5.el6_7.1.x86_64 5/5
Verifying : perl-DBD-MySQL-4.013-3.el6.x86_64 1/5
Verifying : perl-DBI-1.609-4.el6.x86_64 2/5
Verifying : mysql-libs-5.1.73-5.el6_7.1.x86_64 3/5
Verifying : mysql-5.1.73-5.el6_7.1.x86_64 4/5
Verifying : mysql-server-5.1.73-5.el6_7.1.x86_64 5/5 Installed:
mysql.x86_64 0:5.1.73-5.el6_7.1 mysql-server.x86_64 0:5.1.73-5.el6_7.1 Dependency Installed:
mysql-libs.x86_64 0:5.1.73-5.el6_7.1 perl-DBD-MySQL.x86_64 0:4.013-3.el6
perl-DBI.x86_64 0:1.609-4.el6 Complete!
此时,我们通过如下命令查看刚安装好的mysql-server的版本:
[root@localhost carsonzhu]# rpm -qi mysql-server
Name : mysql-server Relocations: (not relocatable)
Version : 5.1.73 Vendor: CentOS
Release : 5.el6_7.1 Build Date: 2016年03月23日 星期三 02时10分16秒
Install Date: 2016年05月22日 星期日 14时37分04秒 Build Host: c6b8.bsys.dev.centos.org
Group : Applications/Databases Source RPM: mysql-5.1.73-5.el6_7.1.src.rpm
Size : 25883011 License: GPLv2 with exceptions
Signature : RSA/SHA1, 2016年03月23日 星期三 03时36分21秒, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem <http://bugs.centos.org>
URL : http://www.mysql.com
Summary : The MySQL server and related files
Description :
MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
client/server implementation consisting of a server daemon (mysqld)
and many different client programs and libraries. This package contains
the MySQL server and some accompanying files and directories.
三、mysql数据库的初始化和相关配置
我们在安装完mysql数据库以后,会发现会多出一个mysqld的服务,这个就是咱们的数据库服务,我们通过输入 service mysqld start 命令就可以启动我们的mysql服务。
注:如果是第一次启动mysql服务,mysql服务器首先会进行初始化的配置,如:
[root@localhost carsonzhu]# service mysqld start
初始化 MySQL 数据库: Installing MySQL system tables...
OK
Filling help tables...
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/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' Alternatively you can run:
/usr/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 ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! [确定]
正在启动 mysqld: [确定]
我们会看到第一次启动mysql服务器以后会提示非常多的信息,目的就是对mysql数据库进行初始化操作,再次重启mysql服务时,就不会提示那么多信息了:
[root@localhost carsonzhu]# service mysqld start
正在启动 mysqld: [确定]
查看mysql服务是否为开机自动启动:
[root@localhost carsonzhu]# chkconfig --list | grep mysqld
mysqld 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
将其设置为开机启动:
[root@localhost carsonzhu]# chkconfig mysqld on
[root@localhost carsonzhu]# chkconfig --list | grep mysqld
mysqld 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
当然,想再次关闭开机启动也很简单:
[root@localhost carsonzhu]# chkconfig mysqld off
[root@localhost carsonzhu]# chkconfig --list | grep mysqld
mysqld 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
mysql数据库安装完以后只会有一个root管理员账号,但是此时的root账号还并没有为其设置密码,在第一次启动mysql服务时,会进行数据库的一些初始化工作,在输出的一大串信息中,有这样一行信息 :
/usr/bin/mysqladmin -u root password 'new-password' // 为root账号设置密码
设置mysql数据库的root账号((注:这个root账号是mysql的root账号,非Linux的root账号)):
[root@localhost carsonzhu]# mysqladmin -u root password 'carsonzhu'
(将root账号密码设置为carsonzhu)
登录mysql数据库:
[root@localhost carsonzhu]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.73 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 |
| test |
+--------------------+
3 rows in set (0.02 sec) mysql>
四、mysql数据库的主要配置文件
1、/etc/my.cnf 是mysql的主配置文件
[root@localhost carsonzhu]# cd
[root@localhost ~]# ls
anaconda-ks.cfg install.log install.log.syslog
[root@localhost ~]# cd /home
[root@localhost home]# ls
carsonzhu
[root@localhost home]# find / -name etc
/usr/local/etc
/usr/lib/vmware-tools/lib32/libconf/etc
/usr/lib/vmware-tools/lib64/libconf/etc
/usr/etc
/usr/share/doc/oddjob-0.30/sample/etc
/usr/share/festival/lib/etc
/usr/lib64/festival/etc
/tmp/vmware-tools-distrib/lib/lib32/libconf/etc
/tmp/vmware-tools-distrib/lib/lib64/libconf/etc
/tmp/vmware-tools-distrib/caf/etc
/tmp/vmware-tools-distrib/etc
/etc
[root@localhost home]# cd /
[root@localhost /]# ls
bin dev lib media net root sr0 tmp var
boot etc lib64 misc opt sbin srv Tools
cdrom home lost+found mnt proc selinux sys usr
[root@localhost /]# cd etc
[root@localhost /]# ls
bin dev lib media net root sr0 tmp var
boot etc lib64 misc opt sbin srv Tools
cdrom home lost+found mnt proc selinux sys usr
[root@localhost /]# cd etc
[root@localhost etc]# ls
abrt hp printcap
acpi httpd profile
adjtime idmapd.conf profile.d
aliases init protocols
aliases.db init.d pulse
alsa inittab purple
alternatives inputrc quotagrpadmins
anacrontab ipa quotatab
anthy-conf iproute2 rc
asound.conf issue rc0.d
at.deny issue.net rc1.d
audisp java rc2.d
audit jvm rc3.d
autofs_ldap_auth.conf jvm-commmon rc4.d
auto.master kde rc5.d
auto.misc kdump-adv-conf rc6.d
auto.net kdump.conf rc.d
auto.smb krb5.conf rc.local
avahi latrace.conf rc.sysinit
bash_completion.d latrace.d readahead.conf
bashrc ld.so.cache redhat-lsb
blkid ld.so.conf redhat-release
bluetooth ld.so.conf.d request-key.conf
bonobo-activation libaudit.conf request-key.d
cas.conf libreport resolv.conf
centos-release libuser.conf rpc
certmonger localtime rpm
chkconfig.d login.defs rsyslog.conf
ConsoleKit logrotate.conf rsyslog.d
cron.d logrotate.d rwtab
cron.daily lsb-release rwtab.d
cron.deny lsb-release.d samba
cron.hourly ltrace.conf sane.d
cron.monthly lvm sasl2
crontab magic scl
cron.weekly mailcap securetty
crypttab mail.rc security
csh.cshrc makedev.d selinux
csh.login man.config services
cups maven sestatus.conf
dbus-1 mime.types setuptool.d
default mke2fs.conf sgml
depmod.d modprobe.d shadow
dhcp motd shadow-
DIR_COLORS mtab shells
DIR_COLORS.256color mtools.conf skel
DIR_COLORS.lightbgcolor my.cnf smartd.conf
dnsmasq.conf nanorc snmp
dnsmasq.d netconfig sos.conf
dracut.conf NetworkManager sound
dracut.conf.d networks ssh
drirc nfsmount.conf ssl
enscript.cfg nsswitch.conf sssd
environment ntp statetab
ethers ntp.conf statetab.d
event.d obex-data-server sudo.conf
exports oddjob sudoers
favicon.png oddjobd.conf sudoers.d
festival oddjobd.conf.d sudo-ldap.conf
filesystems openldap sysconfig
fonts opt sysctl.conf
foomatic PackageKit system-release
fprintd.conf pam.d system-release-cpe
fstab pango terminfo
gai.conf passwd tpvmlp.conf
gconf passwd- Trolltech.conf
gcrypt pbm2ppa.conf udev
gdm pcmcia updatedb.conf
ghostscript pinforc vimrc
gnome-vfs-2.0 pkcs11 virc
gnupg pki vmware-caf
group plymouth vmware-tools
group- pm warnquota.conf
grub.conf pm-utils-hd-apm-restore.conf wgetrc
gshadow pnm2ppa.conf wpa_supplicant
gshadow- polkit-1 X11
gssapi_mech.conf popt.d xdg
gtk-2.0 portreserve xinetd.d
hal postfix xml
host.conf ppp yp.conf
hosts prelink.cache yum
hosts.allow prelink.conf yum.conf
hosts.deny prelink.conf.d yum.repos.d
[root@localhost etc]# ls my.cnf
my.cnf
[root@localhost etc]# cat my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0 [mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
2、/var/lib/mysql mysql数据库的数据库文件存放位置
[root@localhost etc]# cd /var
[root@localhost var]# cd lib/mysql
[root@localhost mysql]# ls -1
ibdata1
ib_logfile0
ib_logfile1
mysql //mysql数据库安装时默认的两个数据库文件
mysql.sock
test //mysql数据库安装时默认的两个数据库文件
自己创建一个数据库,并验证该数据库文件的存放位置:
[root@localhost mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.73 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> create database carsontest ;
Query OK, 1 row affected (0.01 sec) mysql> exit
Bye
[root@localhost mysql]# ls -1
carsontest
ibdata1
ib_logfile0
ib_logfile1
mysql
mysql.sock
test
[root@localhost mysql]# cd carsontest
[root@localhost carsontest]# ls
db.opt
3、/var/log mysql数据库的日志输出存放位置
[root@localhost carsontest]# cd
[root@localhost ~]# cd /var/log
[root@localhost log]# ls
anaconda.ifcfg.log gdm secure-20160517
anaconda.log httpd secure-20160522
anaconda.program.log lastlog spice-vdagent.log
anaconda.storage.log maillog spooler
anaconda.syslog maillog-20160305 spooler-20160305
anaconda.xlog maillog-20160517 spooler-20160517
anaconda.yum.log maillog-20160522 spooler-20160522
audit messages sssd
boot.log messages-20160305 tallylog
btmp messages-20160517 vmware-caf
btmp-20160517 messages-20160522 vmware-install.log
ConsoleKit mysqld.log vmware-vmsvc.log
cron ntpstats wpa_supplicant.log
cron-20160305 pm-powersave.log wtmp
cron-20160517 ppp Xorg.0.log
cron-20160522 prelink Xorg.0.log.old
cups sa Xorg.9.log
dmesg samba yum.log
dmesg.old secure
dracut.log secure-20160305
因为我们的mysql数据库是可以通过网络访问的,并不是一个单机版数据库,其中使用的协议是 tcp/ip 协议,我们都知道mysql数据库绑定的端口号是 3306 ,所以我们可以通过 netstat -anp 命令来查看一下,Linux系统是否在监听 3306 这个端口号:
[root@localhost log]# netstat -anp | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name
tcp 0 0 0.0.0.0:38029 0.0.0.0:*
LISTEN 1788/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:*
LISTEN 1742/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:*
LISTEN 1961/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:*
LISTEN 1845/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:*
LISTEN 2131/master
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN 20295/mysqld
tcp 1 0 192.168.1.20:53892 61.213.168.17:80
CLOSE_WAIT 2723/clock-applet
tcp 1 0 192.168.1.20:53891 61.213.168.17:80
CLOSE_WAIT 2723/clock-applet
tcp 0 0 :::40843 :::*
LISTEN 1788/rpc.statd
tcp 0 0 :::111 :::*
LISTEN 1742/rpcbind
结果如上所示,Linux系统监听的3306端口号就是我们的mysql数据库!
可参考文章:Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
另外一种安装方式:CentOS7安装mysql5.6.26
linux学习之centos(三):mysql数据库的安装和配置的更多相关文章
- Linux学习之CentOS6下Mysql数据库的安装与配置
转自:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...
- Linux学习之CentOS--CentOS6.下Mysql数据库的安装与配置
跟着配置,顺利配置完成 http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html
- CentOS 下Mysql数据库的安装与配置
一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常 的方便,在Linux上如果要安装数据库, ...
- linux应用之mysql数据库的安装及配置(centos)
CentOS下Mysql数据库的安装与配置 如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲 ...
- Linux学习之CentOS(三)--初识linux的文件系统以及用户组等概念
Linux学习之CentOS(三)--初识linux的文件系统以及用户组等概念 进入到了Linux学习之CentOS第三篇了,这篇文章主要记录下对linux文件系统的初步认识,以及用户组.用户权限.文 ...
- MySQL数据库的安装与配置(windows)
MySQL是目前最为流行的开放源码的数据库,是完全网络化的跨平台的关系型数据库系统,它是由瑞典MySQLAB公司开发,目前属于Oracle公司.任何人都能从Internet下载MySQL软件,而无需支 ...
- mysql数据库的安装与配置
mysql数据库的安装与配置及workbench的简单使用 mysql数据库社区版下载:https://dev.mysql.com/downloads/installer/ 我这里选的是社区安装版(适 ...
- [转] Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
from: http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得 ...
- Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
原文:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...
随机推荐
- ucml 查询组件
查询视图组件通常用于通过某些字段来查询数据,在页面设计处选好需要查询的字段,并设置操作符等信息最后设计页面添加执行查询的按钮即可,页面效果同编辑视图组件. 具体操作示例: 1.添加一个新的查询组件VC ...
- ucml选项卡
当业务视图组件VC并排摆放时就会形成选项卡,本章介绍选项卡有关的操作函数和事件. 页面中有三个对象:TabStrip,Panel和Tab,TabStrip含Panel对象和Tab对象.业务单元BPO没 ...
- 【spring-boot神器】第一篇:拦截器,过滤器,监听器,控制器,消息转换器,AOP执行顺序
整理一下这几天学习的资料和代码 第一部分.上代码 1.spring各种器的实现,idea搭建spring-boot的教程在这里http://www.jianshu.com/p/9082a533fa3c ...
- layui前端框架之分页
框架环境:SSM框架 为了保证效果,此次演示也用到了jQuery ui框架,大家最好也引入进来 一.去layui官网下载包,解压后,然后导入文件中,最好放再main/webapp文件夹下 官网地址如下 ...
- PAT A1010 Radix (25 分)——进制转换,二分法
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The an ...
- java线程状态和获取线程基本信息
1. 线程状态 新生状态 用 new 关键字建立一个线程后,该线程对象就处于新生状态.处于新生状态的线程有自己的内存空间,通过调用start()方法进入就绪状态. 就绪状态 处于就绪状态线程具备了运行 ...
- day82
今日内容: 1.CBV源码分析: CBV:class base view(基于类的视图函数) FBV:function base view(基于方法的视图函数) 要想使用CBV首先需要导入 from ...
- Redis详解(八)------ 主从复制
前面介绍Redis,我们都在一台服务器上进行操作的,也就是说读和写以及备份操作都是在一台Redis服务器上进行的,那么随着项目访问量的增加,对Redis服务器的操作也越加频繁,虽然Redis读写速度都 ...
- Luogu3220 HNOI2012 与非 数位DP
传送门 题意:给出$N$个范围在$[0,2^k-1]$的整数,定义位运算$NAND$为位运算$AND$的逆运算,求$[L,R]$中有多少数能成为若干个前面给出的整数.若干括号和$NAND$运算组成的表 ...
- Luogu4652 CEOI2017 One-Way Streets 树上差分
传送门 题意:给出$N$个点.$M$条无向边的图,现在你需要给它定向,并满足$Q$个条件:每个条件形如$(x_i,y_i)$,表示定向之后需要存在路径从$x_i$走向$y_i$.问每条边是否都有唯一定 ...