设为首页 加入收藏

TOP

Linux下MySQL 5.7.23无法远程连接解决方案(二)
2018-12-02 22:09:03 】 浏览:258
Tags:Linux MySQL 5.7.23 无法 远程 连接 解决方案
oDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



保存后,重启服务sudo service mysql restart.


2.无验证进入mysql数据库修改user表中root账号信息,flush privileges;


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A


Database changed
mysql> update mysql.user set authentication_string=password('账号密码') where user='root';
Query OK, 0 rows affected, 1 warning (0.03 sec)
Rows matched: 3  Changed: 0  Warnings: 1


mysql> update user set plugin="mysql_native_password";
Query OK, 1 row affected (0.00 sec)
Rows matched: 7  Changed: 1  Warnings: 0


mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)


mysql> quit
Bye


3./etc/mysql/mysql.conf.d/mysqld.cnf文件,去掉skip-grant-tables,开启校验


4.重启服务


sudo service mysql restart;


至此就搞定了,使用jdbc、非Linux root账号都可以登录了。


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MongoDB 4.0 Sharded Cluster部署 下一篇Linux系统下virtuoso数据库安装与..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目