mysql for linux 命令安装_MySQL for linux安装详解

shell> groupadd mysql

shell> useradd -g mysql mysql

Configure the release and compile everything:配置和编译

shell> ./configure --prefix=/usr/local/mysql

--prefix后面指示了默认安装路径

shell> make

如果还想知道更详细的configure命令,请查阅manual for configure

If you want to set up an option file, use one of those present in

the ‘support-files’ directory as a template. For example:如果你想安装选项文件,使用当前存在的‘support-files’ 文件夹下的作为模板,例如:

shell> cp support-files/my-medium.cnf /etc/my.cnf

If you haven`t installed MySQL before, you must create the MySQL

grant tables:如果你以前没有安装过MySQL,你必须创建一个MySQL准许的表

shell> bin/mysql_install_db --user=mysql

Change the ownership of program binaries to ‘root’ and ownership

of the data directory to the user that you will run ‘mysqld’ as.

Assuming that you are located in the installation directory

(‘/usr/local/mysql’), the commands look like this:将程序的所有权限给‘root’ ,并且把数据目录的所有权给可以运行‘mysqld’的用户。假设MySQL的安装目录是(‘/usr/local/mysql’),命令如下所示:

shell> chown -R mysql var

shell> chgrp -R mysql .

The first command changes the owner attribute of the files to the ‘root’ user. 第一行命令把文件拥有权给‘root’。The second changes the owner attribute of the data directory to the ‘mysql’ user. 第二行把数据目录拥护权给‘mysql’用户。The third changes the group attribute to the ‘mysql’ group.第三行把组的权限给‘mysql’组。

After everything has been installed, you should initialize and test your distribution using this command:万事具备后,你就可以按照下面的命令测试并运行你的MySQL了:

shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值