Home > Database > Mysql Tutorial > body text

Ubuntu 12.04.04 server环境里的mysql使用

WBOY
Release: 2016-06-07 15:39:57
Original
1075 people have browsed it

1,mysql 的远程访问设置 Mysql默认是不可以通过远程机器访问的,通过下面的配置可以开启远程访问 在MySQL Server端: 执行cd /etc/mysql sudo vi my.cnf 将其中的bind-address 修改为0.0.0.0 执行sudo mysql 命令进入mysql 命令模式, mysql use mysql; mysq

1,mysql 的远程访问设置
Mysql默认是不可以通过远程机器访问的,通过下面的配置可以开启远程访问 

在MySQL Server端: 

执行cd /etc/mysql

      sudo vi my.cnf

将其中的bind-address 修改为0.0.0.0

执行sudo mysql 命令进入mysql 命令模式, 
mysql> use mysql;   
mysql> GRANT ALL ON *.* TO admin@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION;   
#这句话的意思 ,允许任何IP地址(上面的 % 就是这个意思)的电脑 用admin帐户  和密码(admin)来访问这个MySQL Server   
#必须加类似这样的帐户,才可以远程登陆。 root帐户是无法远程登陆的,只可以本地登陆  
考虑到安全性,在系统中创建wlan用户,执行
 GRANT ALL ON test.* TO wlan@'%' IDENTIFIED BY 'wlan' WITH GRANT OPTION;

 这样,wlan用户就可以从远端访问test库里所有内容了   


2.安装windows平台的mysql软件,进入mysql query browser。输入相关参数后远程连接linux下数据库服务。

3.mysql 常用命令。

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!