MySQL学习笔记2-System administration(set password)
2015-11-17 15:51
816 查看
安装完毕后,第一次登录mysql,修改密码
[root@localhost bin]# service mysql start
Starting MySQL.. SUCCESS!
[root@localhost bin]# cat /root/.mysql_secret
# The random password set for the root user at Tue Nov 17 21:33:33 2015 (local time): d08oVJ5RDL5c5YVP
[root@localhost bin]# mysql -pd08oVJ5RDL5c5YVP -uroot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.27
Copyright (c) 2000, 2015, 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.
mysql> set password for 'root'@'localhost' =password('');
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@localhost bin]# mysql -p -uroot
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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.
mysql> set password for 'root'@'localhost' =password('mysql');
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@localhost bin]#
[root@localhost bin]# service mysql start
Starting MySQL.. SUCCESS!
[root@localhost bin]# cat /root/.mysql_secret
# The random password set for the root user at Tue Nov 17 21:33:33 2015 (local time): d08oVJ5RDL5c5YVP
[root@localhost bin]# mysql -pd08oVJ5RDL5c5YVP -uroot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.27
Copyright (c) 2000, 2015, 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.
mysql> set password for 'root'@'localhost' =password('');
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@localhost bin]# mysql -p -uroot
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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.
mysql> set password for 'root'@'localhost' =password('mysql');
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@localhost bin]#
相关文章推荐
- mysql 主从设置
- mysql连接超时的参数设置
- mysql 分页存储过程
- MySQL · 特性分析 · MDL 实现分析
- mysql查询优化需要注意的20点?
- Mysql导出表结构及表数据 mysqldump用法
- MySQL_join开发技巧
- 转载于烂泥博客,供个人学习kvm、mysql等知识
- 转载于烂泥博客,供个人学习kvm、mysql等知识
- mysql my.ini 详解
- C#连接、访问MySQL数据库
- MySQL学习笔记2-System administration(uninstall mysql)
- Ubuntu下开启mysql的bin_log日志
- mysql水平分表和垂直分表和数据库分区
- Mysql cpu 100% 服务接口性能定位 (一)
- vs2005 以ADO方式连接mysql
- mysql 1293错误 建表两个timestamp
- mysql统计一年中每周的数据
- MySQL主从复制(半同步)
- 《Mysql技术内幕》札记(上)