美文网首页
linux离线安装mysql

linux离线安装mysql

作者: bigdata张凯翔 | 来源:发表于2020-06-11 13:39 被阅读0次

1.上传压缩包
2.解压
3.查看已安装的mysql rpm -qa |grep mysql
4.删除已安装的mysql rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps
5.安装我们自己的rpm包 rpm -ivh *.rpm
6.设置mysql的root密码,首先后台启动mysql cd /usr/lib
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
7.进入mysql终端:mysql -u root mysql
8.设置密码: UPDATE user SET Password=PASSWORD('admin') where USER='root' and host='root' or host='localhost';
9.刷新权限:FLUSH PRIVILEGES;
10.退出mysql exit;
11.重启mysql:/etc/init.d/mysql restart
12 重新使用新密码登陆 mysql -uroot -p

  1. 重新设置一下密码:SET PASSWORD = PASSWORD('admin');
    13.开启远程登陆:Grant all privileges on . to 'root'@'%' identified by 'admin' with grant option;
    14.刷新权限列表 :FLUSH PRIVILEGES;

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

卸载mysql
停止mysql服务 service mysql stop
查看所有mysql的安装包 rpm -qa | grep -i mysql
卸载所有mysql的安装包 rpm -e MySQL-test-5.6.17-1.el6.x86_64 MySQL-shared-5.6.17-1.el6.x86_64 MySQL-devel-5.6.17-1.el6.x86_64 MySQL-shared-compat-5.6.17-1.el6.x86_64 MySQL-embedded-5.6.17-1.el6.x86_64 MySQL-server-5.6.17-1.el6.x86_64 MySQL-client-5.6.17-1.el6.x86_64 --nodeps
查看是否卸载干净 rpm -qa | grep -i mysql
查看哪里还有mysql的文件夹 whereis mysql
删掉 rm -rf /usr/lib64/mysql
删掉 rm -rf /usr/my.cnf
删掉 rm -rf /root/.mysql_secret
删掉 rm -rf /var/lib/mysql

mysql因为服务器硬件原因,主要是内存不足,导致mysql进程很容易宕机死掉的解决办法,mysql报出错误 SQLSTATE 08S01,communication failure
解决方案:
前天,想测试一下小站-095网址导航(http://www.095.me)的连接速度,在网上找了下,找到这个测试网站速度的网站,http://www.webkaka.com/webCheck.aspx,
但测试后就出问题了,数据库连接不上,小站也找不开了。于是想,会不会是因为硬件太低,所于数据库出现问题,启动了不。
于是到/var/log查看了数据库的日志,看到了Got an error: Connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock',在网上找了了,发现很多帖都是你抄我我抄你的,不过也没有关系,有效就行了。但试了很多个都不行。后来看到一位大牛的说增加swap空间可以解决这个问题,于是按他所说的去做了。果然,再次使用测速网站去测试打开网速也不会出现同样的问题了。
解决方法如下:
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo mkswap /swapfile
sudo swapon /swapfile
sudo vi /etc/fstab
添加"/swapfile swap swap defaults 0 0"到末尾,不包括引号,如果不会使用vi,请自己网上查资料。
保存,退出,重新启动。

相关文章

  • mysql配置安装

    Mysql离线安装文档 第一大部分 Linux离线安装mysql 要用到编译工具(cmake)以及库文件。 可以使...

  • Mysql5.7 最新版离线下载安装

    linux mysql 5.7 离线安装(tar.gz) 1. 官网下载压缩包 mysql 下载地址 https:...

  • linux离线安装mysql

    1.上传压缩包2.解压3.查看已安装的mysql rpm -qa |grep mysql4.删除已安装的mysq...

  • CentOs7离线安装Mysql(详细安装过程)

    删除原有的Mariadb和mysql Mysql安装-下载mysql离线安装包 Downloads:mysql:5...

  • crunch自动生成字典

    安装 linux在线安装'''sudo apt-get install crunch'''linux离线安装资源连...

  • linux 离线安装mysql5.6.x

    linux离线下使用通用安装包安装mysql5.6.x,并设置自启动,特别注意是5.6.x版本,不同版本安装略有差...

  • redhat7.5 离线安装docker

    linux 离线安装docker 下载镜像: https://download.docker.com/linux/...

  • mysql

    linux系统安装mysql数据库 Linux下安装mysql 这个比较好用 Linux 中设置 MySQL 字符...

  • mysql 安装

    包含 windows、linux、mac下mysql安装,linux下MariaDB安装 下载 MySQL 5.7...

  • centos7.4 安装mysql 5.7

    参考文档 Mysql5.7 Linux安装教程 linux下mysql安装link MySQL的my.cnf文件(...

网友评论

      本文标题:linux离线安装mysql

      本文链接:https://www.haomeiwen.com/subject/xjlbtktx.html