ubuntu安装包的命令
Redhat一般是rpm -ivh。
ubuntu是基于Debian的发行版,所以使用的是Deb包,一般不能安装RPM
deb包或直接允许命令 sudo apt-get install 软件名称
如果想要安装PRM的话,要用其他的rpm系列的Linux,比如Fedora、openSUSE
在使用命令时可能会报错:dpkg -i mysql-common_5.7.28-1ubuntu16.04_amd64.deb
root@yita-212:/opt/soft# dpkg -i mysql-common_5.7.28-1ubuntu16.04_amd64.deb
dpkg: 无法恢复的致命错误,中止: statoverride 文件有无效组 lp
解决:将lp卸载掉
按顺序安装
首先要下载离线包:
mysql-server_5.7.28-1ubuntu16.04_amd64.deb-bundle.tar,加压后按以下顺序安装:
dpkg -i mysql-common_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient20_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient-dev_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i libmysqld-dev_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-client_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-client_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-source_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-server_5.7.28-1ubuntu16.04_amd64.deb**
报错解决:
1)root@yita-212:/opt/soft# dpkg -i mysql-community-client_5.7.28-1ubuntu16.04_amd64.deb
dpkg: 依赖关系问题使得 mysql-community-client 的配置工作不能继续:
mysql-community-client 依赖于 libaio1 (>= 0.3.93);然而: 未安装软件包 libaio1。
解决:本来可以直接在资源中心下载,但是股份那边修改了ip,我们这边暂时访问不了了,只能从外网下载好再安装:
dpkg -i libaio1_0.3.110-2_amd64.deb
2)dpkg: 依赖关系问题使得 mysql-community-server 的配置工作不能继续:
mysql-community-server 依赖于 libmecab2 (>= 0.996-1.2ubuntu1);然而: 未安装软件包 libmecab2
解决:
dpkg -i libmecab2_0.996-1.2ubuntu1_amd64.deb
这时输入密码:123456(可以自己设置)
dpkg -i mysql-common_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient20_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient-dev_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i libmysqld-dev_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-client_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-client_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-source_5.7.28-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-server_5.7.28-1ubuntu16.04_amd64.deb**
测试是否装成功
root@yita-212:/opt/soft# mysql -V
mysql Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using EditLine wrapper
root@yita-212:/opt/soft# mysql -u root -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.28 MySQL Community Server (GPL)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select uuid();
+--------------------------------------+
| uuid() |
+--------------------------------------+
| 8d6bedf3-287d-11ea-827f-38d547289ec1 |
+--------------------------------------+
1 row in set (0.00 sec)
修改了数据库的文件后进入失败
Redhat上是/etc/my.cnf
Ubuntu上是/etc/mysql/mysql.conf.d/my.cnf
mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
mysql -h 127.0.0.1 -uroot -p123456 又是可以了