源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

mysql 5.7.14 安装配置代码分享

  • 时间:2021-07-08 04:01 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:mysql 5.7.14 安装配置代码分享
本文记录了mysql 5.7.14 安装配置代码,具体内容如下 OS: CentOS 6.6   DB: Mysql 5.7.14   [b]1. 下载mysql [/b]  cd /tools   wget root@localhost: 8aahkRkxfm%t  密码是: 8aahkRkxfm%t  [b]11 创建一个启动脚本[/b]  [root@zw-test-db data]# cd /usr/local/mysql/  [root@zw-test-db mysql]# cp support-files/mysql.server /etc/init.d/mysql   cp: overwrite `/etc/init.d/mysql'? y  [b]12.启动mysql的三种方式[/b]  [b]方式一:[/b] 
root@zw-test-db bin]# ./mysqld_safe --user=mysql &
[1] 12455 
[root@zw-test-db bin]# 160830 15:18:01 mysqld_safe Logging to '/usr/local/mysql/data/zw-test-db.err'. 
160830 15:18:01 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 

[b]方式二:[/b] 
[root@zw-test-db bin]# /etc/init.d/mysqld restart
Shutting down MySQL..160830 15:18:14 mysqld_safe mysqld from pid file /usr/local/mysql/data/zw-test-db.pid ended
        [ OK ]
 
Starting MySQL.      [ OK ] 
[1]+ Done   ./mysqld_safe --user=mysql 

[b]方式三:[/b] 
[root@zw-test-db bin]# service mysqld restart 
Shutting down MySQL..     [ OK ]
Starting MySQL.      [ OK ] 
[root@zw-test-db bin]# 
[b]13. 添加环境变量 [/b][b] [/b] echo "export PATH=\$PATH:/usr/local/mysql/bin" >> /root/.bash_profile  source /root/.bash_profile  [b]14. 登陆[/b] 
[root@zw-test-db mysql]# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 3 
Server version: 5.7.14-log 


Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. 


Oracle is a registered trademark of Oracle Corporation and/or its 
affiliates. Other names may be trademarks of their respective 
owners. 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 

root@localhost [(none)]>show databases; --提示要修改密码 
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. 

[b]15.修改密码[/b] 
root@localhost [(none)]>alter user user() identified by '123456'; 
Query OK, 0 rows affected (0.00 sec) 

mysql> flush privileges; 
Query OK, 0 rows affected (0.00 sec) 

root@localhost [(none)]>show databases;
+--------------------+ 
| Database  | 
+--------------------+ 
| information_schema | 
| mysql  | 
| performance_schema | 
| sys  | 
+--------------------+ 
4 rows in set (0.00 sec) 
可以查看数据库了  [b]16. 5.6版本之前需要帐号安全加固,[/b]5,7以后 test数据库都没有了 
delete from mysql.user where user!='root' or host!='localhost'; --删除非root用户,登陆主机不是localhost的账号 
flush privileges; 
alter user user() identified by '123456'; 
drop database test; 
truncate mysql.db;

精彩专题分享:[url=http://www.1sucai.cn/Special/832.htm]mysql不同版本安装教程[/url] [url=http://www.1sucai.cn/Special/863.htm]mysql5.7各版本安装教程[/url] 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程素材网。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部