linux安装mysql8.0.17

1:mysql8.0下载地址

https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz

2:安装步骤,参考直通车

	[参考二:](https://my.oschina.net/u/928852/blog/1840371)

3:修改密码:mysql -uroot -p

alter user user() identified by "123456";

4:navicat连接失败,报错’caching_sha2_password’ cannot be loaded,参考直通车

5:可能会出现的问题

  • 我遇到的坑:Operation ALTER USER failed for ‘root’@‘localhost’
    解决直通车

  • 服务启动失败:
    在这里插入图片描述
    注释掉:

    #log-error=/var/log/mariadb/mariadb.log
    #pid-file=/var/run/mariadb/mariadb.pid
    

my.cnf 文件

[mysqld]
    basedir = /usr/local/mysql   
    datadir = /usr/local/mysql/data
    socket = /usr/local/mysql/mysql.sock
    character-set-server=utf8
    port = 3306
   sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[client]
   socket = /usr/local/mysql/mysql.sock
   default-character-set=utf8
[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
default_authentication_plugin=mysql_native_password

得执行生效:

flush privileges;

内存不足解决办法:

直通车

The server quit without updating PID file (/usr/local/mysql[FAILED]stance-fp0ma14n.pid).

权限不足

/usr/local/mysql/bin/mysqld_safe --user=root &

服务不能启动可参考

https://www.cnblogs.com/richiewlq/p/7521343.html

解决办法:

rm -rf /usr/local/mysql/data

chown -R mysql.mysql .

cd /usr/local/mysql

bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

/usr/local/mysql/bin/mysqld_safe --user=root &

/etc/init.d/mysqld start

use mysql

update user set host=’%’ where user=‘root’ limit 1;

ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘123456’;

alter user user() identified by “123456”;

内存不足导出mysql服务挂掉:

参考地址:https://blog.csdn.net/qq_41133227/article/details/94392512
我的my.cnf配置

 [mysqld]
    basedir = /usr/local/mysql   
    datadir = /usr/local/mysql/data
    socket = /usr/local/mysql/mysql.sock
    character-set-server=utf8
    port = 3306
   sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
 [client]
   socket = /usr/local/mysql/mysql.sock
   default-character-set=utf8
key_buffer=16K
table_open_cache=4
query_cache_limit=256K
query_cache_size=4M
max_allowed_packet=1M
sort_buffer_size=64K
read_buffer_size=256K
thread_stack=64K
innodb_buffer_pool_size = 56M
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值