博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql 5.7 二进制安装方法
阅读量:4648 次
发布时间:2019-06-09

本文共 2252 字,大约阅读时间需要 7 分钟。

shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> cd /usr/localshell> tar zxvf /path/to/mysql-VERSION-OS.tar.gzshell> ln -s full-path-to-mysql-VERSION-OS mysqlshell> cd mysqlshell> mkdir mysql-filesshell> chmod 750 mysql-filesshell> chown -R mysql .shell> chgrp -R mysql .shell> bin/mysql_install_db --user=mysql    # Before MySQL 5.7.6shell>./bin/mysqld  --initialize --user=mysql --datadir=/home/mysql/mysql3316/data/ # MySQL 5.7.6 and up
2016-08-03T09:04:12.255526Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-03T09:04:12.538185Z 0 [Warning] InnoDB: New log files created, LSN=45790 2016-08-03T09:04:12.592864Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2016-08-03T09:04:12.605358Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3f0b6c52-5959-11e6-8c68-00163e415703. 2016-08-03T09:04:12.606217Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2016-08-03T09:04:12.607201Z 1 [Note] A temporary password is generated for : w+&E:13EZDnq shell>./bin/mysql_ssl_rsa_setup --datadir=/home/mysql/mysql3316/data/            # MySQL 5.7.6 and upshell> chown -R root .shell> chown -R mysql data mysql-filesshell> bin/mysqld_safe --user=mysql &# Next command is optionalshell> cp support-files/mysql.server /etc/init.d/mysql.server
 
shell> mysql -uroot -p'w+&E:13EZDnq' -hlocalhost --socket=/tmp/mysql3316.sock --port=3316
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> set password = password('mypass');   //一定要设置一下新密码
 
还有一种情况,就是不知道初始化密码 vi /etc/my.cnf 在[mysqld]下面增加一行 skip-grant-tables 重启  /etc/init.d/mysqld restart /usr/local/mysql/bin/mysql -uroot  mysql> update user set authentication_string=password('123333') where user='root'; 退出来后,更改my.cnf,去掉刚加的 skip-grant-tables 重启 /etc/init.d/mysqld restart 此时就可以使用新的密码了。

 

转载于:https://www.cnblogs.com/sgphappy2007/p/5733851.html

你可能感兴趣的文章
SharePoint Designer cannot open site error " the server could not complete your request"
查看>>
期末项目设计图-教务管理系统
查看>>
一、HTML语言
查看>>
GeoHash核心原理解析
查看>>
蓝桥杯练习系统历届试题 翻硬币
查看>>
排序算法----桶排序(数组)
查看>>
40_并发编程-事件
查看>>
函数式编程
查看>>
apache2.2:使一个目录允许执行cgi程序
查看>>
Windows下,MySQL root用户忘记密码解决方案
查看>>
mybatis做like模糊查询
查看>>
Mongodb地理位置索引
查看>>
国外公司技术博客盘点
查看>>
机房收费系统-- MDI子窗体显示技巧
查看>>
学习笔记
查看>>
Linux netstat命令详解和使用例子(显示各种网络相关信息)
查看>>
作业2结对(升级版)
查看>>
谁记录了mysql error log中的超长信息
查看>>
把数据输出到Word (非插件形式)
查看>>
Android演示Stack(课下作业)
查看>>