CentOS7 64位下MySQL5.7安装与配置(YUM)
CentOS7安装MySQL5.7
1. 配置yum源
#下载MySQL yum 源
$ wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
$ ls
# 使用sudo,为所有用户安装mysql源
$ sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm
# 检查yum源是否安装成功,如下图
$ yum repolist enabled |grep "mysql.*-community.*"
# 修改要安装的MySQL版本
vim /etc/yum.repos.d/mysql-community.repo
# 修改对影响的enable
2. 安装和启动MySQL
# install
$ sudo yum install mysql-community-server
# start
$ sudo systemctl start mysqld
$ sudo systemctl status mysqld
# stop
$ sudo systemctl stop mysqld
$ sudo systemctl status mysqld
3. 开机启动设置
$ sudo systemctl enable mysqld
$ sudo systemctl daemon-reload
4. 修改root默认密码
$ grep 'temporary password' /var/log/mysqld.log
$ sudo systemctl start mysqld
$ sudo mysql -uroot -p #输入mysqld.log中的密码
mysql> set password for 'root'@'localhost'=password('myPassw0rd_');
5. 设置默认编码为utf8
mysql> show variables like '%character%';
$ sudo vim /etc/my.cnf
$ sudo systemctl restart mysqld
$ sudo mysql -uroot -p #新密码
mysql> show variables like '%character%';
- 配置文件:/etc/my.cnf
- 日志文件:/var/log//var/log/mysqld.log
- 服务启动脚本:/usr/lib/systemd/system/mysqld.service
- socket文件:/var/run/mysqld/mysqld.pid
CentOS 下安装 Node.js
CentOS7 安装NodeJS
CentOS 7 安装 Node.js 6
1. 下载解压源码
$ wget https://nodejs.org/dist/latest-v6.x/node-v6.11.3-linux-x64.tar.gz
$ tar zxvf node-v6.11.3-linux-x64.tar.gz
2. 查看版本
$ cd node-v6.11.3-linux-x64
$ ls
bin CHANGELOG.md include lib LICENSE README.md share
# 没有configure文件,这个版本是可以直接使用的,查看版本
$ cd bin
$ ./node -v
v6.11.3
3. 配置环境变量参考
$ sudo vim /etc/profile
# 移动node文件夹到/usr/myinstall/
# 在 export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL 一行的上面添加:
# 2017-09-27 set for node.js by XXX
export NODE_HOME = /usr/myinstall/node-v6.11.3-linux-x64
export PATH=$NODE_HOME/bin:$PATH
$ echo $PATH
$ source /etc/profile
$ echo $PATH
$ node -v
$ npm -v
3.10.10