您的位置:首页 > 运维架构 > Linux

CentOS_mysql8.0_安装

2018-09-06 11:44 330 查看

#参考资料

官网:https://dev.mysql.com/doc/refman/8.0/en/binary-installation.html

个人博客:https://www.xingchenw.cn/article/179

 博客园:http://www.cnblogs.com/guanshanmao/p/9233898.html

CSDN:https://blog.csdn.net/xintingandzhouyang/article/details/80956348

 

#yum安装mysql

  1. wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
  2. rpm -ivh mysql80-community-release-el7-1.noarch.rpm
  3. yum install mysql-server -y
  4. grep "temporary password" /var/log/mysqld.log
  5. mysql -u root -p
  6. alter user 'root'@'localhost' identified by '新密码';

 

#通用二进制包安装mysql

  1. //准备工作
  2. yum install libaio-devel numactl-devel -y
  3. groupadd mysql
  4. useradd -g mysql -s /bin/false mysql
  5. vim /etc/my.cnf
  6. datadir=/usr/local/mysql/data
    socket =/usr/local/mysql/mysql.sock
    
    #symbolic-links=0
    
    log-error=/usr/local/mysql/mysql.log
    pid-file =/usr/local/mysql/mysql.pid

  7. chmod 644 /etc/my.cnf
  8. //下载解压
  9. wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz
  10. xz -d mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz
  11. tar -xvf mysql-8.0.12-linux-glibc2.12-x86_64.tar
  12. mv mysql-8.0.12-linux-glibc2.12-x86_64/ /usr/local/mysql
  13. chown -R mysql:mysql /usr/local/mysql
  14. cd /usr/local/mysql
  15. touch mysql.log
  16. //配置启动
  17. bin/mysqld --initialize --user=mysql
  18. bin/mysql_ssl_rsa_setup
  19. bin/mysqld_safe --user=mysql &
  20. cp support-files//mysql.server /etc/rc.d/init.d/mysqld
  21. service mysqld start

  22. bin/mysql -u root -p
  23. alter user 'root'@'localhost' identified by '新密码';
阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: