当前位置:   article > 正文

Linux安装Mysql_8.0.18_linux rpm安装mysql8.0.18 报upacking of archive failed

linux rpm安装mysql8.0.18 报upacking of archive failed on file libmysqlcl

 

1.下载MySQL,http://dev.mysql.com/downloads/mysql/

 

选择适合你的版本下载即可。

2.将下载MySQL包上传到linux,进行解压:tar -xvf mysql.....

3.移动并修改文件名: mv /bigdata/mysql-8.0.18-linux-glibc2.12-x86_64.tar /usr/local/mysql

4.新建mysql用户、组及目录:groupadd mysql;useradd -r -s /sbin/nologin -g mysql mysql -d /usr/local/mysql

5.创建数据仓库目录:mkdir /data/mysql;

6.改变目录属有者:chown -R mysql .chgrp -R mysql .;chown -R mysql /data/mysql;【注:分号前的' .'】

7.初始化:① bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql 【注意你的参数值】

 此处需要注意记录生成的临时密码,如上文结尾处的: o9dQXD_R,g&w

② bin/mysql_ssl_rsa_setup  --datadir=/data/mysql

8.修改系统配置文件:

① cp mysql.server /etc/init.d/mysql   【mysql.server 在你mysql_home的support-files目录中】

vim /etc/init.d/mysql

  1. basedir=/usr/local/mysql
  2. datadir=/data/mysql

② vi /etc/my.cnf

  1. [mysqld]
  2. datadir=/usr/local/mysql/
  3. datadir=/data/mysql/
  4. socket=/data/mysql/mysql.sock
  5. # Disabling symbolic-links is recommended to prevent assorted security risks
  6. symbolic-links=0
  7. # Settings user and group are ignored when systemd is used.
  8. # If you need to run mysqld under a different user or group,
  9. # customize your systemd unit file for mariadb according to the
  10. # instructions in http://fedoraproject.org/wiki/Systemd
  11. log-error=/usr/local/mysql/mysqld.log
  12. [mysqld_safe]
  13. log-error=/var/log/mariadb/mariadb.log
  14. pid-file=/var/run/mariadb/mariadb.pid
  15. character_set_server=utf8
  16. init_connect='SET NAMES utf8'
  17. #
  18. # include all files from the config directory
  19. #
  20. !includedir /etc/my.cnf.d

9.启动: /etc/init.d/mysql start

/etc/init.d/mysql start

10.登陆:

mysql -hlocalhost -uroot -p

输入:第七步时候生成的临时密码 o9dQXD_R,g&w

输入完后无问题直接进入,而我在此报错。。。

①错误1

解决方式:ln -s /data/mysql/mysql.sock /tmp/mysql.sock 【注:/data/mysql/mysql.sock文件地址根据实际情况填写】

②  错误2
Starting MySQL.The server quit without updating PID file (/data/mysql//vm10-38-248-204.ksc.com.pid).                                      [失败]

解决方式:配置 vi /etc/my.cnf

11.登陆到mysql第一件事就是修改临时密码,不然你操作任何命令,都是报错:

修改密码:alter user 'root'@'localhost' identified by '123456';

12.添加系统路径
# vim /etc/profile
添加:
export PATH=/usr/local/mysql/bin:$PATH

source /etc/profile

13.设置系统命令,不然无法使用service mysqld status

①find / -name mysql.server

②cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

14.mysql服务设置远程连接 解决1251 client does not support ..问题

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'newpassword';

附加:

Linux杀掉MySQL进程(关键词:Linux/MySQL/杀死进程/mysql/mysqld)
1.查看mysql程序对应的进程号使用命令:ps -e|grep mysql
2.杀死mysql进程使用命令:sudo kill -9 mysql的进程号
3.杀死mysqld进程使用命令:sudo killall mysqld
4.检查是否还有mysql进程存在使用命令:psps -e|grep mysql

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/495046
推荐阅读
相关标签
  

闽ICP备14008679号