Linux CentOS MySQL 5.7.18安装教程
2018-08-28 14:21
411 查看
1、新建用户组和用户
2、解压Mysql软件包
3、重命名解压后的文件夹
4、创建数据目录
5、初始化数据库
执行完命令后,会看到如下输出信息,注意记住root密码,后续步骤需要用到。
6、数据库配置-mysqld
修改/etc/init.d/mysqld文件,正确设置basedir,datadir。
7、配置数据库-my.cnf
在/etc目录下创建my.cnf配置文件。
my.cnf配置文件内容如下:
8、修改密码
9、启动数据库
mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
groupadd mysql useradd mysql -g mysql
2、解压Mysql软件包
tar -zxvf /data/soft/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz -C /data/webserver
3、重命名解压后的文件夹
cd /data/webserver mv mysql-5.7.18-linux-glibc2.5-x86_64 mysql
4、创建数据目录
mkdir data chown -R mysql:mysql /data/webserver/mysql/ chmod -R 755 /data/webserver/mysql/
5、初始化数据库
cd /data/webserver ./bin/mysqld --user=mysql --basedir=/data/webserver/mysql --datadir=/data/webserver/mysql/data --initialize
执行完命令后,会看到如下输出信息,注意记住root密码,后续步骤需要用到。
6、数据库配置-mysqld
cp /data/webserver/mysql/support-files/mysql.server /etc/init.d/mysqld chmod 755 /etc/init.d/mysqld vi /etc/init.d/mysqld
修改/etc/init.d/mysqld文件,正确设置basedir,datadir。
7、配置数据库-my.cnf
在/etc目录下创建my.cnf配置文件。
vi /etc/my.cnf
my.cnf配置文件内容如下:
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html [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 = ..... basedir=/data/webserver/mysql # datadir = ..... datadir=/data/webserver/mysql/data # port = ..... # server_id = ..... # socket = ..... #socket=/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 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES ft_min_word_len = 1 innodb_buffer_pool_size = 6G innodb_buffer_pool_instances = 8 innodb_buffer_pool_load_at_startup = 1 innodb_buffer_pool_dump_at_shutdown = 1 innodb_lru_scan_depth = 2000 innodb_lock_wait_timeout = 5 innodb_io_capacity = 4000 innodb_io_capacity_max = 8000 innodb_flush_method = O_DIRECT innodb_file_format = Barracuda innodb_file_format_max = Barracuda innodb_undo_logs = 128 innodb_flush_neighbors = 1 innodb_log_file_size = 4G innodb_log_buffer_size = 16777216 innodb_purge_threads = 4 innodb_large_prefix = 1 innodb_thread_concurrency = 64 innodb_print_all_deadlocks = 1 innodb_strict_mode = 1 innodb_sort_buffer_size = 67108864
8、修改密码
/data/webserver/mysql/bin/mysql -uroot -p SET PASSWORD = PASSWORD('123456'); grant all privileges on *.* to root@'%' identified by '123456'; flush privileges;
9、启动数据库
service mysqld start
mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
相关文章推荐
- 使用YUM在Linux(CentOS 7)下安装mysql 5.7.18的教程详解
- linux (centos) 安装MySql详细教程!!实战详解
- Linux(CentOS 6.5) 下安装MySql 5.7.18 二进制版本粗浅攻略
- CentOS 7 中以命令行方式安装 MySQL 5.7.11 for Linux Generic 二进制版本教程详解
- centos 6.5 安装mysql-5.7.18-linux-glibc2.5-x86_64
- CentOS 7 中以命令行方式安装 MySQL 5.7.11 for Linux Generic 二进制版本教程详解
- Linux/Centos安装Litespeed+PHP+MYSQL+PHPMYADMIN教程
- linux(centos)上安装mysql教程
- Linux(centos)下mysql编译安装教程
- centos6.4下mysql5.7.18安装配置方法图文教程
- linux(CentOS6.5)下安装Mysql5.6教程
- [Linux]Centos7下mysql小白安装教程
- 【数据库】-【DB】-Linux CentOS6.5下编译安装MySQL 5.6.16【给力详细教程】-安装-单机
- centos 7.3 安装 mysql-5.7.18-linux-glibc2.5-x86_64
- Linux CentOS6.5下编译安装MySQL 5.6.16【给力详细教程】
- CentOS6.5下安装mysql-5.7.18-linux-glibc2.5-x86_64
- centos下yum搭建安装linux+apache+mysql+php环境教程
- CentOS 7 中以命令行方式安装 MySQL 5.7.11 for Linux Generic 二进制版本教程详解,
- CentOS 6.5 i386 安装MySQL 5.7.18详细教程