Home > Database > Mysql Tutorial > linux mysql免安装版_MySQL

linux mysql免安装版_MySQL

WBOY
Release: 2016-06-01 13:35:21
Original
1226 people have browsed it

bitsCN.com

linux mysql免安装版

 

1. mysql官网下载mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz

 

2. 解压tar -xvf mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz

 

3. cp support-files/my-default.cnf ./my.cnf

 

把配置文件放到解压目录下,也可放到/etc/my.cnf,但是这里是免安装嘛,放本目录更好,呵呵

 

修改my.cnf,设置basedir datadir。

 

测了下这个版本不能设置default-character-set,说没有这个参数了,所以就不要设置字符集了,默认是latin1,创建数据库的时候再设置字符集吧,不知道这样会不会有问题,简单测了下是没问题的

 

4. 执行:/scripts/mysql_install_db --user=root

 

5. 启动mysql

 

./bin/mysqld_safe --user=root

 

6. 把mysql加到系统服务中:

 

cp support-files/mysql.server /etc/rc.d/init.d/mysqld

 

修改mysqld,设置basedir和datadir

 

因为mysqld_safe启动时默认用的用户是mysql,而脚本中没有指定--user,所以可自行修改脚本,在mysqld_safe命令处加上参数:--user=root

 

chmod 700 /etc/init.d/mysqld 

 

chkconfig --add mysqld 

 

chkconfig --level 345 mysqld on

 

  service mysqld start/stop/restart

 

7. 网上安装mysql的文章都说要建用户组及用户mysql,感觉对于一般管理,不用建用户,用root好像也没啥不好

 

bitsCN.com
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