Marlon's Blog

记录生活、技术中的二三事.


  • Home

  • Archives

  • Tags

  • Bio

linux下mysql允许外部访问

Published at: 2014-12-15   |   Reading: 267 words ~1min

设置mysql 的配置文件

/etc/mysql/my.cnf找到bind-address =127.0.0.1将其注释掉;//作用是使得不再只允许本地访问; 重启mysql:/etc/init.d/mysql restart;

进入mysql 数据库

mysql -u root -p,mysql>grant all privileges on *.* to root@'%' identifies by ' xxxx';其中 第一个*表示数据库名;第二个*表示该数据库的表名;如果像上面那样 *.*的话表示所有到数据库下到所有表都允许访问;‘%’:表示允许访问到mysql的ip地址;当然你也可以配置为具体到ip名称;%表示所有ip均可以访问;后面到‘xxxx’为root 用户的password;

#mysql#
  • Author: Marlon Fan
  • Link: https://www.marlon.life/2014/12/15/linux%E4%B8%8Bmysql%E5%85%81%E8%AE%B8%E5%A4%96%E9%83%A8%E8%AE%BF%E9%97%AE/
  • License: All articles in this blog are licensed under CC BY-NC-ND 4.0 unless stating additionally.
嗯,又一次选择
laravel excel包使用
Marlon Fan

Marlon Fan

宁静致远

48 Blogs
30 Tags
Homepage GitHub Twitter Zhihu
Friends
    过往云烟
© 2008 - 2024 Marlon Fan. All rights reserved. 晋ICP备20002733号-1
0%