Home > Database > Mysql Tutorial > body text

Debian下MySQL安装经验分享

WBOY
Release: 2016-06-07 16:53:10
Original
1282 people have browsed it

在Debian下安装MySQL,步骤如下: Debian: /# apt-get install mysql-server 装好之后要缺省root是没有密码的,可以更

  在Debian下安装MySQL,步骤如下:

  Debian: /# apt-get install mysql-server

  装好之后要缺省root是没有密码的,可以更改.

  Debian: /# mysqladmin -u root password $(yourpass)

  在/etc/mysql/my.conf里面可以修改一些属性。

  原来有这么一行:bind-address = 127.0.0.1

  意思是限定只有本机才能访问,愿意是为了保证数据安全。现在想要使得远程的机器能够访问MySQL数据库服务,就可以通过改bind-address来实现, 两种方式:

  1. bind-address = 0.0.0.0

  2. 直接把bind-address这一行注释掉

  这样做完之后,执行以下命令:

  /etc/init.d/mysql stop
  /etc/init.d/mysql start

  也有的说/etc/init/d/mysql reload, 但是有时候好像会出奇怪的问题,,用上面两步比较好。Ossim官方网站上说改成 bind-address = *, 我试了,行不通,浪费我好多时间。

  这样几步做完之后,还赋予远程机器访问权限:

  mysql > GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'root_password' WITH GRANT OPTION;

  上面这条命令的意思是允许任何IP地址(%是通配符)的电脑用root帐户和密码(root_password)来访问这个MySQL Server。

  这下就好了。

linux

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!