#查看版本和内核cat /etc/issue
#查看下载源cat /etc/apt/sources.list
#查询安装包
apt-cache search mysql
#设置root密码sudopasswd root
#切换用户su root
#安装包apt-getinstall mysql-server-5.7 -y
#查看进程状态
systemctl status mysql
#查询文件和安装路径whereis mysql
find / -name mysql
#有没有防火墙
ufw status
#端口状态netstat -an|grep 3306
#查看安装的所有软件dpkg -l | grep ftp
dpkg -l
#查看软件安装的路径
dpkg -L |grepftpwhereisftp#查看用户是否创建cat /etc/passwd
#查看用户组cat /etc/group
#修改用户组 将ftp加入ubuntu组中usermod –g ubuntu ftp#查看用户所在的用户组groupsftp
服务器状态
Ubuntu 18.04.4 LTS
mysql安装
apt-cache search mysql
apt-getinstall mysql-server-5.7 -y
systemctl status mysql
#登录mysql 初始登录root用户没密码
mysql -uroot -p
#mysql创建用户
CREATE USER 'xxx'@'%' IDENTIFIED BY 'xxxx';#修改mysql配置文件绑定ip bind-address = 127.0.0.1 取消
vim /etc/mysql/mysql.conf.d/mysqld.cnf
#重启mysql服务service mysql restart
#创建数据库和用户
CREATE DATABASE IF NOT EXISTS wordpress DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci;#授权
grant all privileges on xxxx.* to xxxx@'%';
flush privileges;
quit;