5 月 172016
 

错误信息

Login Error

Incorrect username, password or no permission to use the Nexus User Interface.
Try again. Please login before attempting further requests.

替代密码(admin123)

f865b53623b121fd34ee5426c792e5c33af8c227

停止nexus服务

[root@maven ~]# /usr/local/nexus-2.11.4-01/bin/nexus stop
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Stopping Nexus OSS...
Stopped Nexus OSS.
[root@maven ~]#

进入目录,修改配置文件

[root@maven ~]# cd /usr/local/sonatype-work/nexus/conf
[root@maven conf]# cp security.xml security.xml.backup
[root@maven conf]# vi security.xml

替换用户配置中<password></password>的密码

<user>
 <id>admin</id>
 <firstName>Administrator</firstName>
 <lastName>User</lastName>
 <password>f865b53623b121fd34ee5426c792e5c33af8c227</password>
 <status>active</status>
 <email>changeme@yourcompany.com</email>
</user>

重新启动nexus服务

[root@maven conf]# /usr/local/nexus-2.11.4-01/bin/nexus start
5 月 132016
 

开放http/80,https/443服务
限定ssh/22服务只能从内网10.169.138.158访问
限定udp/161端口只能从内网10.169.138.158访问

[root@localhost ~]# firewall-cmd --permanent --add-service=http
success
[root@localhost ~]# firewall-cmd --permanent --add-service=https
success
[root@localhost ~]# firewall-cmd --permanent --add-port=161/udp
success
[root@localhost ~]# firewall-cmd --permanent --remove-service=ssh
success
[root@localhost ~]# firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.169.138.158/24" service name="ssh" accept"
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# firewall-cmd --list-all
public (default)
 interfaces:
 sources:
 services: dhcpv6-client http https
 ports: 161/udp
 masquerade: no
 forward-ports:
 icmp-blocks:
 rich rules:
 rule family="ipv4" source address="10.169.138.158/24" service name="ssh" accept
[root@localhost ~]#

[root@localhost ~]# firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.169.138.158/24" destination address="10.46.128.24/24" port port="161" protocol="udp" accept"
success
[root@localhost ~]# firewall-cmd --permanent --remove-port=161/dup
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# firewall-cmd --list-all
public (default)
 interfaces:
 sources:
 services: dhcpv6-client http https
 ports: 
 masquerade: no
 forward-ports:
 icmp-blocks:
 rich rules:
 rule family="ipv4" source address="10.169.138.158/24" service name="ssh" accept
 rule family="ipv4" source address="10.169.138.158/24" destination address="10.46.128.24/24" port port="161" protocol="udp" accept
[root@localhost ~]#
5 月 102016
 

 

查看cp命令别名设置

查看别名

[root@localhost ~]# alias cp
alias cp='cp -i'
[root@localhost ~]#

相关参数

-R, -r, --recursive copy directories recursively
-f, --force if an existing destination file cannot be opened, remove it and try again (redundant if the -n option is used)
-i, --interactive prompt before overwrite (overrides a previous -n option)

注释相关别名配置,并重新登录用户。

[root@localhost ~]# cat ~/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
 . /etc/bashrc
fi
[root@localhost ~]#

使用\转义符号处理。

[root@localhost ~]# ls
anaconda-ks.cfg db.txt install.log install.log.syslog
[root@localhost ~]# touch abc.txt
[root@localhost ~]# ls
abc.txt anaconda-ks.cfg db.txt install.log install.log.syslog
[root@localhost ~]# \cp -rf install.log abc.txt
[root@localhost ~]# ll
total 36
-rw-r--r-- 1 root root 8835 May 10 10:12 abc.txt
-rw-------. 1 root root 1107 Nov 9 2015 anaconda-ks.cfg
-rw-r--r-- 1 root root 744 May 7 11:07 db.txt
-rw-r--r--. 1 root root 8835 Nov 9 2015 install.log
-rw-r--r--. 1 root root 3314 Nov 9 2015 install.log.syslog
[root@localhost ~]#
5 月 072016
 

查询用户和权限

mysql> select * from mysql.user\G;

mysql> select * from mysql.user where user='root' \G;

mysql> show grants for root\G;

创建用户

mysql>use mysql;

mysql>insert into mysql.user(Host,User,Password) values("localhost","test",password("1234"));

删除用户

mysql>use mysql;

mysql>Delete FROM user Where User='test' and Host='localhost';

mysql>flush privileges;

修改密码

mysql>update mysql.user set password=password('newpwd') where User="test" and Host="localhost";

mysql>flush privileges;
5 月 052016
 

在CentOS 6.7下安装MySQL 5.6版本

下载并安装官方Yum源

[root@localhost ~]# yum -y install http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm

查看RPM安装包路径

[root@localhost ~]# rpm -lq mysql57-community-release-el6-8
/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
/etc/yum.repos.d/mysql-community-source.repo
/etc/yum.repos.d/mysql-community.repo
[root@localhost ~]#

查看并修改mysql-community.repo文件
启用(enable=1)需要安装的版本,禁用(enable=0)不需要的版本

[root@localhost ~]# vi /etc/yum.repos.d/mysql-community.repo
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

查看仓库列表的启用及禁用状态

mysql-yum-repo-quick-guide-01

更新本地cache后查看mysql-community-server版本信息mysql-yum-repo-quick-guide-02

安装

相关引用:

MySQL Yum repository supports the following Linux Distros:

Red Hat Enterprise Linux 7 / Oracle Linux 7
Red Hat Enterprise Linux 6 / Oracle Linux 6
Red Hat Enterprise Linux 5 / Oracle Linux 5
Fedora 21, 22 and 23

MySQL Yum repository includes the latest packages:

 MySQL 5.7 (GA)
 MySQL 5.6 (GA)
 MySQL 5.5 (GA - Red Hat Enterprise Linux and Oracle Linux Only)
 MySQL Workbench
 MySQL Fabric
 MySQL Router
 MySQL Utilities
 MySQL Connector / ODBC
 MySQL Connector / Python
 MySQL Shell (preview)

下载地址
http://dev.mysql.com/downloads/repo/yum/

官方指南
http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/