查看正在运行的程序:
ps a
杀死进程:
kill - 9 [PID]
查找文件
find / -name [文件名]
1、打开系统--首选项--文件管理;
2、在打开的窗口中切换到行为,选中“总是在浏览器窗口打开“,然后点击关闭即可。
mysql其他命令:
show databases; 显示数据库(注意分号)
show tables; 显示表
describe tablename; 显示具体的表结构
设置开机自启动
eg:chkconfig mysqld on
分一个内网Ip用桥接模式
上外网用NAT模式
压缩成tar.gz的方法
# tar -zcvf archive_name.tar.gz directory_to_compress
解压缩到当前目录:
# tar -zxvf archive_name.tar.gz
解压缩到指定目录:
# tar -zxvf archive_name.tar.gz -C /tmp/extract_here/
将文件file1复制成文件file2
cp file1 file2
将目录dir1复制成目录dir2
cp -R dir1 dir2
查找已安装的myslq 版本:
#rpm -qa | grep mysql (注意大小写,如果mysql 不行就换MySQL)
[root@iZ25k8f0f3lZ ~]# rpm -qa |grep mysql
mysql-5.1.73-8.el6_8.x86_64
mysql-libs-5.1.73-8.el6_8.x86_64
mysql-devel-5.1.73-8.el6_8.x86_64
mysql-server-5.1.73-8.el6_8.x86_64
[root@iZ25k8f0f3lZ ~]#
查看mysql安装路径
[root@iZ25k8f0f3lZ ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/local/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
其中:
usr/bin/mysql 是指:mysql的运行路径
var/lib/mysql 是指:mysql数据库文件的存放路径
usr/lib/mysql 是指:mysql的安装路径
卸载mysql
[root@iZ25k8f0f3lZ ~]# rpm -e mysql-server-5.1.73-8.el6_8.x86_64
[root@iZ25k8f0f3lZ ~]# rpm -e mysql-devel-5.1.73-8.el6_8.x86_64
[root@iZ25k8f0f3lZ ~]# rpm -e mysql-5.1.73-8.el6_8.x86_64
[root@iZ25k8f0f3lZ ~]# rpm -e --nodeps mysql-libs-5.1.73-8.el6_8.x86_64(nodeps表示强制删除)
安装好Mysql后,
【问题】:启动过程中若遇到
[root@iZ25k8f0f3lZ ~]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
查看/var/log/mysqld.log文件,若遇到
170426 15:15:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
^G/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
170426 15:15:23 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
170426 15:15:24 InnoDB: Initializing buffer pool, size = 8.0M
170426 15:15:24 InnoDB: Completed initialization of buffer pool
170426 15:15:24 InnoDB: Started; log sequence number 0 44233
170426 15:15:24 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
170426 15:15:24 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
170426 15:15:24 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
【解决方法】:
[root@iZ25k8f0f3lZ mysql]# find / -name mysql_install_db
/usr/bin/mysql_install_db
[root@iZ25k8f0f3lZ mysql]# cd /usr/bin/
[root@iZ25k8f0f3lZ bin]# ./mysql_install_db --user=mysql
若运行mysql后仍出现下面的情况
[root@iZ25k8f0f3lZ ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
则再次卸载mysqld,并重新安装
抓包:(23020端口)
tcpdump -i eth1 port 23020 -nn -A