1-Mysql 搭建
来源:互联网 发布:开火锅店成本预算 知乎 编辑:程序博客网 时间:2024/06/16 17:48
1. 首先添加用户跟用户组
# groupadd mysql# useradd -g mysql mysql -d /usr/local/share/mysql -s /sbin/nologin
2. 解压缩文件到指定目录
# tar -zxvf mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz -C /usr/local/share/
Mysql 的主目录
3. 配置
设置Mysql目录的权限
[EVA@EVA share]# mv mysql-5.7.15-linux-glibc2.5-x86_64/ mysql[EVA@EVA share]# cd mysql/[EVA@EVA mysql]# mkdir data[EVA@EVA mysql]# mkdir tmp[EVA@EVA mysql]# cd ..[EVA@EVA share]# chown -R mysql:mysql mysql/
拷贝配置文件
# cp support-files/my-default.cnf /etc/my.cnf
使用 Mysql 来初始化数据库
# bin/mysqld --initialize --user=mysql --basedir=/usr/local/share/mysql --datadir=/usr/local/share/mysql/data
# bin/mysql_ssl_rsa_setup --datadir=/usr/local/share/mysql/data
设置/etc/init.d/mysqld
# cp support-files/mysql.server /etc/init.d/mysqld# vi /etc/init.d/mysqld basedir=/usr/local/share/mysqldatadir=/usr/local/share/mysql/data
设置 /etc/my.cnf
[mysqld]# Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.# innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin# These are commonly set, remove the # and set as required.basedir = /usr/local/share/mysqldatadir = /usr/local/share/mysql/dataport = 3306# server_id = .....socket = /usr/local/share/mysql/tmp/mysql.sock# Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.# join_buffer_size = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2M default-storage-engine=INNODBcharacter-set-server=utf8collation-server=utf8_general_cisql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES[mysql.server]user=mysqlbasedir=/usr/local/share/mysql[client]socket = /usr/local/share/mysql/tmp/mysql.sockdefault-character-set=utf8
4. 启动 Mysql服务器
启动
[EVA@EVA mysql]# bin/mysqld_safe --user=mysql &
[EVA@EVA mysql]# bin/mysql -uroot -p
修改密码
mysql> set password=password('360628836989');Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> grant all privileges on *.* to root@'%' identified by '360628836989';Query OK, 0 rows affected, 1 warning (0.00 sec)
阅读全文
0 0
- 1-Mysql 搭建
- mysql环境搭建 实例:1
- MySQL搭建
- 搭建mysql
- Mysql搭建
- Mysql搭建
- 【mysql】mysql cluster搭建
- apache+php+mysql的系统搭建(1)
- 框架搭建1-----spring3+hibernate4+mysql
- 搭建Hadoop2.5.2+Hive2.1+Mysql
- MySQL簇--mysql集群搭建
- Mysql Master/Slaver 搭建
- Mysql搭建主从复制
- fedora MySql Cluster 搭建
- PHP Apache Mysql搭建
- mysql主从搭建实现
- mysql 主从环境搭建
- mysql cluster 7.1搭建
- (Reading)From Language to Programs: Bridging Reinforcement Learning and Maximum Marginal Likelihood
- 运维——虚拟机Linux系统联网
- POJ 3264 Balanced Lineup(RMQ)
- SpringBoot自动配置原理
- 【Java新人学习指南】Java基础知识点大梳理
- 1-Mysql 搭建
- webAPI,webService
- Selenium发展史
- HDU 5578 Friendship of Frog(暴力)
- 代理模式小例子1
- 2-Mysql 管理
- 【STL】容器 > 顺序容器 > vector
- 最适合人工智能开发的5种编程语言
- Java集合-07之 Stack