文章详情

短信预约信息系统项目管理师 报名、考试、查分时间动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

mysql-8.0.17绿色安装-centos7

2018-02-27 15:43

关注
[root@08fc27e1d3e3 local]# yum install libaio numactl ncurses-compat-libs
[root@08fc27e1d3e3 local]# wget http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-8.0/mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz
[root@08fc27e1d3e3 local]# xz -d mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz 
[root@08fc27e1d3e3 local]# mv mysql-8.0.17-linux-glibc2.12-x86_64.tar /usr/local/
[root@08fc27e1d3e3 local]# tar -xvf mysql-8.0.17-linux-glibc2.12-x86_64.tar
[root@08fc27e1d3e3 local]# mv mysql-8.0.17-linux-glibc2.12-x86_64/ mysql-8.0.17
[root@08fc27e1d3e3 local]# cd mysql-8.0.17
[root@08fc27e1d3e3 mysql-8.0.17]# vim my.cnf
[mysqld]
user=mysql
character-set-server=utf8mb4
socket=/usr/local/mysql-8.0.17/mysql.sock
datadir=/usr/local/mysql-8.0.17/dat
log-error=/usr/local/mysql-8.0.17/mysqld.log
slow_query_log_file=/usr/local/mysql-8.0.17/slow-query.log
default-storage-engine=InnoDB
explicit_defaults_for_timestamp=true
max_connections=256
slow_query_log=on
long_query_time=2
log_queries_not_using_indexes=off
read_buffer_size=4M
max_allowed_packet=64M
join_buffer_size=128M
sort_buffer_size=2M
read_rnd_buffer_size=2M
innodb_flush_log_at_trx_commit=0
innodb_buffer_pool_size=256M
innodb_buffer_pool_instances=8
bulk_insert_buffer_size=64M
performance_schema=OFF
performance_schema_max_table_instances=64
init_connect="SET NAMES utf8mb4"
#
[client]
default-character-set=utf8mb4
[root@08fc27e1d3e3 mysql-8.0.17]# mkdir dat
[root@08fc27e1d3e3 mysql-8.0.17]# groupadd mysql
[root@08fc27e1d3e3 mysql-8.0.17]# useradd -r -g mysql mysql
[root@08fc27e1d3e3 mysql-8.0.17]# chown -R mysql .
[root@08fc27e1d3e3 mysql-8.0.17]# chgrp -R mysql .
[root@08fc27e1d3e3 mysql-8.0.17]# vim mysqld.log                #创建一个空的mysqld.log
[root@08fc27e1d3e3 mysql-8.0.17]# ls -lht
total 480K
drwxr-xr-x  2 mysql mysql 4.0K Sep 28 07:43 dat
drwxr-xr-x  4 mysql mysql 4.0K Jun 26 22:35 man
drwxrwxr-x  2 mysql mysql 4.0K Jun 26 22:35 run
drwxr-xr-x  3 mysql mysql 4.0K Jun 26 22:35 var
drwxr-xr-x  2 mysql mysql 4.0K Jun 26 22:35 bin
drwxr-xr-x  2 mysql mysql 4.0K Jun 26 22:35 docs
drwxr-xr-x  3 mysql mysql 4.0K Jun 26 22:35 include
drwxr-xr-x  6 mysql mysql 4.0K Jun 26 22:35 lib
drwxr-xr-x 28 mysql mysql 4.0K Jun 26 22:35 share
drwxr-xr-x  2 mysql mysql 4.0K Jun 26 22:35 support-files
-rw-r--r--  1 mysql mysql 330K Jun 25 10:23 LICENSE
-rw-r--r--  1 mysql mysql 100K Jun 25 10:23 LICENSE.router
-rw-r--r--  1 mysql mysql  687 Jun 25 10:23 README
-rw-r--r--  1 mysql mysql  700 Jun 25 10:23 README.router
-rw-r--r--  1 mysql mysql    0 Jun 25 10:23 mysqld.log

[root@7bdc6644c7c4 mysql-8.0.17]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql-8.0.17 --datadir=/usr/local/mysql-8.0.17/dat
2019-09-28T07:48:21.224959Z 0 [System] [MY-013169] [Server] /usr/local/mysql-8.0.17/bin/mysqld (mysqld 8.0.17) initializing of server in progress as process 25931
2019-09-28T07:48:26.899840Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: )t4I7RE8w>yU                    #记住这个密码.
2019-09-28T07:48:28.575259Z 0 [System] [MY-013170] [Server] /usr/local/mysql-8.0.17/bin/mysqld (mysqld 8.0.17) initializing of server has completed
[root@08fc27e1d3e3 mysql-8.0.17]# cp support-files/mysql.server /etc/init.d/
[root@08fc27e1d3e3 mysql-8.0.17]# vim /etc/init.d/mysql.server
 40 # If you want to affect other MySQL variables, you should make your changes
 41 # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
 42 
 43 # If you change base dir, you must also change datadir. These may get
 44 # overwritten by settings in the MySQL configuration files.
 45 
 46 basedir=/usr/local/mysql-8.0.17                         //----
 47 datadir=/usr/local/mysql-8.0.17/dat                     //----
 48 
 49 # Default value, in seconds, afterwhich the script should timeout waiting
 50 # for server start. 
 51 # Value here is overriden by value in my.cnf. 
 52 # 0 means don"t wait at all
 53 # Negative numbers mean to wait indefinitely
201 # Get arguments from the my.cnf file,
202 # the only group, which is read from now on is [mysqld]
203 if test -x "$bindir/my_print_defaults";  then
204   print_defaults="$bindir/my_print_defaults"
205 else
206   # Try to find basedir in /etc/my.cnf
207   conf=/usr/local/mysql-8.0.17/my.cnf                   //---
208   print_defaults=
209   if test -r $conf
210   then
[root@08fc27e1d3e3 mysql-8.0.17]# service mysql.server restart
 ERROR! MySQL server PID file could not be found!
Starting MySQL.. SUCCESS! 
[root@08fc27e1d3e3 mysql-8.0.17]# mysql -uroot -p -S ./mysql.sock
Enter password: 

修改root密码:

mysql> alter user user() identified by "dev5";
mysql> create user "root"@"%" identified by "dev5";
Query OK, 0 rows affected (0.02 sec)
mysql> grant all privileges on *.* to root@"%";
Query OK, 0 rows affected (0.02 sec)
mysql> flush privileges; 
Query OK, 0 rows affected (0.04 sec)
阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯