Ubuntu上的ibdata1文件去哪里了?

在Ubuntu桌面版上使用apt安装MySQL之后,无论使用find还是locate都找不到MySQL的重要文件ibdata1。解决问题的方法很简单,就是切换到root账号之下。

$ locate ibdata1 
$ 
$ su
# locate ibdata1
# /var/lib/mysql/ibdata1

MySQL的数据文件位置

root@TC8304:/var/lib/mysql# ls
auto.cnf         ibdata1      ibtmp1              phpmyadmin  TC8304-slow.log
debian-5.7.flag  ib_logfile0  mysql               sujx
ib_buffer_pool   ib_logfile1  performance_schema  sys

Ubuntu下网络部署CentOS

首先安装DHCP服务

sudo apt install vsftp isc-dhcp-server pxelinux tftpd-hpa

增加DHCP服务指定网卡

sudo vi /etc/default/isc-dhcp-server 
interface="enp0s25"

添加DHCP作用域

sudo vi /etc/dhcp/dhcpd.conf
 subnet 172.16.66.0 netmask 255.255.255.0{
     range 172.16.66.10 172.16.66.100;
     option subnet-mask 255.255.255.0;
     option routers 172.16.66.6;
     option broadcast-address 172.16.66.255;
     filename "pxelinux.0";                                                  
     next-Server 172.16.66.6;
 } 

启动DHCP服务

sudo service isc-dhcp-server start
sudo systemctl status isc-dhcp-server

配置tftp服务

sudo vi /etc/default/tftpd-hpa
#在文件行末添加
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot" 
#然后启动tftp服务
sudo service tftpd-hpa start
sudo systemctl status tftpd-hpa

复制安装文件

cd /var/lib/tftpboot/
sudo mkdir ubuntu centos pxelinux.cfg
cd /usr/lib/syslinux/modules/bios/
sudo cp vesamenu.c32 ldlinux.c32 libutil.c32 /var/lib/tftpboot
cd -
sudo cp /usr/lib/PXELINUX/pxelinux.0 ./

将相应iso解压至/srv/ftp/centos目录
将/srv/ftp/centos/images/pxeboot/目录复制到/var/lib/tftpboot/目录下。
编辑pxelinux.cfg/default文件

default vesamenu.c32
timeout 100
prompt localboot
noescape 1

menu title ##### PXE Deploy Menu #####

Label 1
    menu label ^1 Install CentOS 7.3
    kernel centos/vmlinuz
    initrd centos/initrd.img quiet
    append repo=ftp://172.16.66.6/centos devfs=nomount

Label 2                                                                    
     menu label ^2 Boot from LocalDrive
     localboot


Tips:
1. 需要注意的是centos7版本以前的需要使用method来制定安装源,现在要使用repo来指定,否则会报错。
2. 不需要安装inetutils-inetd和配置xinetd服务了,同时启动xinet和tftpd会出现占用IP Address的报错导致tftp无法启动。

Ubuntu小技巧

系统默认进入字符(console)模式

sudo vi /etc/default/grub

注释掉 GRUB_CMDLINE_LINUX_DEFAULT=”quiet”
把GRUB_CMDLINE_LINUX=”" 改为 GRUB_CMDLINE_LINUX=”text”
去掉 #GRUB_TERMINAL=console 的注释,即 GRUB_TERMINAL=console

sudo update-grub
sudo systemctl set-default multi-user.target
sudo sync

进入命令行模式后,可以如下命令切换回桌面模式

sudo systemctl start lightdm

字符(console)模式下外挂中文平台避免乱码

sudo apt install -y zhcon
echo 'alias zhcon="zhcon --utf8"' |.bashrc
source .bashrc
zhcon

修改字符(console)模式下的字体

redhat系默认使用vga字体,而debian系使用fixed字体。个人更喜欢vga字体。

sudo dpkg-reconfigure console-setup

修改完成之后使用setupcon刷新字体

Ubuntu系统初始化

#!/bin/bash
#安装numix源
add-apt-repository ppa:numix/ppa -y
#安装java jdk
add-apt-repository ppa:webupd8team/java -y
#为知笔记
add-apt-repository ppa:wiznote-team -y
#percona软件
curl https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
#系统更新
apt update
apt dist-upgrade -y

#安装需要功能
apt install -y tasksel vym retext wireshark geany geany-plugins 
apt install -y filezilla unzip unrar p7zip-full
apt install -y fonts-droid-fallback fonts-dejavu* fonts-wqy-* fonts-arphic-uming
apt install -y vsftpd git apache2 php7.0
apt install -y dkms gdebi wiznote
apt install -y oracle-java8-installer oracle-java8-set-default

#美化
apt install -y numix-icon-theme numix-gtk-theme numix-folders numix-icon-theme-circle unity-tweak-tool

#编程所需
apt install -y build-essential gcc g++ automake make autoconf htop vim curl git wget lftp tasksel net-tools ctags
apt install -y python2.7 python2.7-dev python-pip
apt install -y python-easygui python-pygame python-tk python-pyqt5 
apt install -y python-nmap nmap python-numpy mycli
curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc
pip install pip --upgrade

#配置中文化
apt install -y hunspell-en-za hunspell-en-ca hunspell-en-au
apt install -y language-pack-zh-hans libreoffice-help-zh-cn mythes-en-au fcitx-frontend-qt4 libreoffice-l10n-en-gb libreoffice-l10n-zh-cn  libreoffice-help-en-gb thunderbird-locale-en-gb thunderbird-locale-zh-hans libreoffice-l10n-en-za firefox-locale-zh-hans language-pack-gnome-zh-hans thunderbird-locale-zh-cn
apt install -y fcitx-ui-qimpanel fcitx-sunpinyin  fcitx-table-wubi   fcitx-frontend-qt5  hyphen-en-gb fcitx-ui-classic hunspell-en-gb fcitx-module-cloudpinyin fonts-arphic-ukai fcitx fcitx-frontend-gtk3 fcitx-frontend-gtk2  fcitx-pinyin fcitx-libs

#安装服务功能
tasksel install openssh-server
tasksel install basic-ubuntu-server

#安装数据库
MYSQL_PASSWORD=123456
echo "mysql-server-5.7 mysql-server/root_password password ${MYSQL_PASSWORD}
mysql-server-5.7 mysql-server/root_password seen true
mysql-server-5.7 mysql-server/root_password_again password ${MYSQL_PASSWORD}
mysql-server-5.7 mysql-server/root_password_again seen true
" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt install -y --force-yes mysql-server

#配置httpd功能
tasksel install lamp-server
a2enmod deflate rewrite headers expires
apt install -y libapache2-mod-wsgi
service apache2 restart
#apt install -y phpmyadmin

#设置wireshark普通用户启动
chgrp wireshark /usr/bin/dumpcap
chmod 4755 /usr/bin/dumpcap
gpasswd -a $(whomai) wireshark

#虚拟化配置
tasksel install virt-host
apt -y install qemu-kvm libvirt-bin virtinst bridge-utils 
apt -y install libosinfo-bin libguestfs-tools virt-top 
modprobe vhost_net 
apt -y install virt-manager iotop 

#升级系统配置

ldconfig
updatedb
sync

#防火墙配置
ufw enable
service ufw start
ufw allow ssh
ufw allow http
ufw allow https
ufw allow ftp
ufw allow ftps
ufw reload
ufw status
sync
reboot