mysql安装及访问配置

Posted on 2022-09-02 17:46  brad1208  阅读(67)  评论(0编辑  收藏  举报

安装教程参考:https://www.cnblogs.com/hjw-zq/p/8809227.html

下载地址:https://dev.mysql.com/downloads/mysql/

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

 

xz格式解压:https://article.itxueyuan.com/O8rlM

 

初始化时报错解决:https://blog.csdn.net/c20611/article/details/126120776

 

使用原密码修改密码:./bin/mysqladmin -uroot -p password

其他说明:

安装教程走完,密码也改掉了,使用SQLyog登录时报错2058错误,是因为mysql密码加密方式变了,需要进行以下操作:

1、登录mysql(例:用户名root,密码123)

/usr/local/mysql/bin/mysql -u root -p123

 

2、依次执行下方命令:

use mysql;

select user,host from user;

 

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123';

(上面的报错就执行下方的这一个)

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

 

然后在尝试登录就可以了,还有其他问题多搜索搜索

 

mysql启动:service mysqld start

mysql关闭:service mysqld stop

查看mysql是否运行:ps -A | grep mysql

 

错误代码2003:防火墙拦截(包含服务器运营商外放端口拦截)

错误码1130解决:https://www.cnblogs.com/zgqbky/p/13390360.html