登录
首页 >  数据库 >  MySQL

ubuntu 16.04 mysql 5.6 创建新用户并开启远程登录

来源:SegmentFault

时间:2023-02-16 15:26:43 279浏览 收藏

知识点掌握了,还需要不断练习才能熟练运用。下面golang学习网给大家带来一个数据库开发实战,手把手教大家学习《ubuntu 16.04 mysql 5.6 创建新用户并开启远程登录》,在实现功能的过程中也带大家重新温习相关知识点,温故而知新,回头看看说不定又有不一样的感悟!

In order to connect remotely you have to have MySQL bind port: 3306 to your machines IP in

/etc/mysql/mysql.conf.d/mysqld.cnf
Then you have to have created the user in both localhost and '%' wildcard and grant permissions on all DB's as such . See below:

Replace xxx with your IP Address (normally 0.0.0.0)

bind-address= xxx.xxx.xxx.xxx

then

CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';

Then

GRANT ALL ON *.* TO 'myuser'@'localhost';
GRANT ALL ON *.* TO 'myuser'@'%';

Depending on your OS you may have to open port 3306 to allow remote connections.

restart mysql service:

sudo systemctl restart mysql

文中关于mysql的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《ubuntu 16.04 mysql 5.6 创建新用户并开启远程登录》文章吧,也可关注golang学习网公众号了解相关技术文章。

声明:本文转载于:SegmentFault 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>