Home  >  Article  >  Database  >  Freebsd下非root用户的MySQL安装

Freebsd下非root用户的MySQL安装

WBOY
WBOYOriginal
2016-06-07 16:52:29750browse

一、编译安装 ./configure --prefix=安装路径 make make install 运行mysql脚本: 安装目录/bin/ ./mysql_inst

  一、编译安装

  ./configure --prefix=安装路径
  make
  make install

  运行mysql脚本: 安装目录/bin/ ./mysql_install_db --user=XX (xx为Freebsd用户名)

  二、修改配置文件:

  从安装目录/ share/mysql/my-small.cnf 复制一份my.cnf ,,并修改my.cnf以下内容

  【client】
  port = 自定义端口号
  sorket = /home/xx/tmp/mysql.sock (自定义mysql.sock路径)
  【server】
  port = 自定义端口号
  sorket = /home/xx/tmp/mysql.sock (自定义mysql.sock路径)

  三、运行服务

  安装路径/bin/ ./mysqld_safe --defaults-file= my.cnf的绝对路径/my.cnf。

  先从SOCKET方式连接,安装路径/bin/mysql -u root -S /home/xx/tmp/mysql.sock。

  修改USER表中的远程登录权限,并以修改之前的用户权限reload sock文件

  mysqladmin reload -u root -S /home/xx/tmp/mysql.sock。

  四、测试远程连接

  再测试以tcp/ip. port方式连接,安装路径/bin/ mysql -u xx -h (ip) -P (端口号) -p 

linux

Statement:
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