关于重启,启动,暂停

一.mysql

正常重启是“service mysql restart”或”service mysql stop 后 service mysql start “
但如果报错显示” ERROR! MySQL is running but PID file could not be found“,则进行一下方法:
1、ps -ef|grep mysql|grep -v grep|awk '{print $2}'|xargs kill -9
2、service mysqld start

3、修改MySQLroot密码:echo hanguosheng | passwd --stdin root

4、修改MySQL数据库连接权限用户:

Last login: Fri Aug 18 10:17:01 2017 from 192.168.17.179
[root@localhost ~]# mysql -uroot -pHappy456
mysql: [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 6
Server version: 5.7.18-log Source distribution

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

root@localhost:mysql.sock  10:39:  [(none)]>use mysql;
Database changed
root@localhost:mysql.sock  10:39:  [mysql]>select user,host from user;
+-----------+----------------+
| user      | host           |
+-----------+----------------+
| root      | 192.168.10.127 |
| mysql.sys | localhost      |
| root      | localhost      |
+-----------+----------------+
3 rows in set (0.00 sec)

root@localhost:mysql.sock  10:39:  [mysql]>
root@localhost:mysql.sock  10:39:  [mysql]>
root@localhost:mysql.sock  10:39:  [mysql]>create user root@'%' identified by 'Happy456';
Query OK, 0 rows affected (0.02 sec)

root@localhost:mysql.sock  10:40:  [mysql]>grant all privileges on *.* to root@'%';
Query OK, 0 rows affected (0.00 sec)


1.  create user reader@'192.168.12.127' identified by 'shsnc';
2.  grant select on dmp_test.* to  reader@'%';   (grant select,insert,delete,update on dmp_test.* to  reader@'%';)
3.  show grants for reader@'%';

5、服务器端跑SQL脚本

a. mysql -u root -p  (root用户登陆)

b. use dmp_test; (应用要导入脚本的库)

c. source /zlztest/dmp/v1.5/sys_database_user.sql;(执行放在服务器上的SQL脚本)

6. 查看mysql数据库正在执行的SQL语句:select * from PROCESSLIST where info is not null;
kill 1452;

二. redis

1.  127环境配置redis重启步骤:
a.   /datadir/dmp/soft/tomcat-8.0.38-dmp-8080/webapps/dmp/WEB-INF/plugins/steps/allencrypt修改文件allencrypt-redis.properties
b.   /datadir/dmp/soft路径下执行   /usr/local/bin/redis-server /datadir/dmp/soft/redis-3.2.8/redis.conf       启动成功

2. 查redis版本:redis-server --version 和 redis-server -v

3. 查看端口的启动情况:ss -nltp

4. 检测是否有安装redis-cli和redis-server;
[root@localhost bin]# whereis redis-cli
redis-cli: /usr/bin/redis-cli
[root@localhost bin]# whereis redis-server
redis-server: /usr/bin/redis-server

三 . db2

1.  db2 list db directory   -----查看本台机器装了几台db2数据库

2.  db2 connect to db2test      ------查看db2数据库的连接情况,连接db2
    db2 "insert into ZLZ.ZLZ_TEST_2_1_COPY select * from ZLZ.ZLZ_TEST_2_1"   ------执行SQL语句

3.  db2 connect    -----连接db2
    进去输出insert into ZLZ.ZLZ_TEST_2_1_COPY select * from ZLZ.ZLZ_TEST_2_1
   qiut  ------结束

4.重启db2

su - db2inst1  ---切换用户登陆
db2start     ----启动数据库

5.db2的系统用户:SYSCAT,SYSFUN,SYSIBM,SYSIBMADM,SYSIBMINTERNAL,SYSIBMTS,SYSPROC,SYSPUBLIC,SYSSTAT,SYSTOOLS

四 . ftp

1.启动ftp服务器     
   #service vsftpd start
2.重启ftp服务器
   #service vsftpd restart

猜你喜欢

转载自www.cnblogs.com/zlz66/p/9272728.html
今日推荐