Home > Database > Mysql Tutorial > Opening of Mysql remote access

Opening of Mysql remote access

高洛峰
Release: 2016-12-02 14:03:22
Original
995 people have browsed it

 Mysql cannot be accessed through remote machines by default. Remote access can be enabled through the following configuration.

 My Mysql environment is ubuntu+mysql5

 1. Modify /etc/mysql/my.conf, modify bind-address, Designated as the actual IP address of this machine, your my.con will probably look like the following after modification


  [mysqld]
  #
  #* Basic Settings
  #
 default-character-set=utf8
 default-storage-engine= INNODB
 bind-address   = 192.168.1.107
  user        = mysql
  pid-file    =/var/run/mysqld/mysqld.pid
  socket    =/var/run/mysq ld/mysqld.sock
 port     =3306
 basedir    =/usr
 datadir     =/var/lib/mysql
  tmpdir     =//tmp
  language    =/usr/share/mysql/english
 skip-external-locking


  2. Log in to mysql with root Execute the following command


 grant all onsonardb .* to sonar@'%' identified by '123456';
grant all on sonardb. Username, replace 123456 with your password, thus enabling the remote access function.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
Mysql cannot start
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template